You are probably looking for
C-u M-RET which calls
org-insert-heading with a prefix argument. The doc string for
With a ‘C-u’ prefix, set ‘org-insert-heading-respect-content’ to
a non-nil value for the duration of the command. This forces the
insertion of a heading after the current subtree, independently
on the location of point.
So if you are in the first-level subtree, it will go to the end of the subtree and insert a first-level heading, but if you are in a second-level subtree, it will go to the end of that and insert a second-level heading. In this second case, there is no way to guess that you want a first level heading, so you'll have to adjust the level with
M-<right> as I mentioned in the comment.
If you really want a first-level heading at the end of the current subtree, you can define a function and bind it to a key (but IMO, that's a waste):
(defun ndk/org-insert-top-level-heading-at-end-of-current-subtree ()
(org-insert-heading '(4) nil t))
(define-key 'org-mode-map (kbd "S-<f12>") #'ndk/org-insert-top-level-heading-at-end-of-current-subtree)
org-insert-heading behave the same way that it would if it were called interactively with a
C-u prefix and the
t forces it to insert a first-level headline instead of what it normally would. I bound it to
S-<f12> because that is likely unused but you can suit yourself.