Creating a new folder in Finder
The behaviour you are seeing is the way it is supposed to work.  As @benwiggy said in a comment your location is as displayed in the toolbar and that is where a new folder will be created.
I can accept that you do not like this - you are probably not the only one. I can see two alternatives:

Use 'column' view.  With this view your focus/location changes as
you go down the folder hierarchy.

Look for a third party Finder replacement which has the behaviour you
would like.  For example:
Path Finder which behaves in the way you would like.
ForkLift which behaves like Finder.