How do you divide a rounded rectangle using pathfinder using Illustrator?

I’d like to create a rounded rectangle that’s cut evenly in half with the flat edge in the middle left open (#4). Once I created my rectangle using the rounded rectangle tool I created a line using the line segment tool in order to divide it in half (#1). Then I’ll select both the line segment and the rounded rectangle and use the pathfinder divide tool. This causes the space in between to be filled with a black line (#2). Once the two halves are ungrouped the solid black line stays as part of the individual shapes (#3).
How do you divide a rounded rectangle using pathfinder using Illustrator?

Illustrator: How to trim lines in a circle?

im working on a little analyses drawing but im stuck with trimming some lines. Im drawing infrastructure with a circle over it to specify a location of intrest. But i need to cut the lines (drawn with the pen tool) to the contour of the circle. (i know its weird what im saying lol, please look at the pictures). Im using pathfinder tool and it worked the first time (see picture) but now it wont.

Group Selection and Pathfinder Unite Behaviour is difficult to understand

I’m at the beginning of my learning journey with Illustrator and am watching this videos to learn Badge Drawing, I Appreciate people prefer not to watch in order to answer, but I’m not skilled enough to break it down into steps, I’ll just write down what I hear for now. From minute 12:46 in the clip