To justify the question here two screenshots:
Does the result in first screenshot makes sense? Is there anybody who just wants to see title of the note in the note itself?
My suggestion: if the highest present header level appears just one time in the note then do not fold it but just all heading beginning from the levels below
Another criticism: The place of the commands provokes the misunderstanding that the command will be applied just on the clicked header and its subheaders. Maybe the notes menu would be a better place whereas the commands in the headers menu could indeed be related to just this header and its subheaders