Again, it is not an obvious problem because the issue is in trimming whitespace characters after saving the page. Of course, the last subheading will look like all the other subheading lines. That's not where the problem is.
I know that the problem is in trimming whitespace characters because I recently edited the page and added a hard return (carriage return) character at the end, saved the page, and it formatted the last subheading correctly.
Then there was a recent change in how pages are saved. The problem showed up again. Again, I put in a hard return (carriage return) and saved the page, and the formatting was not fixed. I open the page, and the carriage return character is no longer there, ergo, it is being trimmed off upon save.
I've been doing software engineering for over 25 years. So I've seen this before. The solution is pretty simple: don't trim all the trailing whitespace characters on a page, and leave the last Carriage Return (CR) character. That will cause the wiki formatting to properly format the subheading on the last line.