I strongly agree with @Sim Yeon.

I just like to add that the end wasn't perfect, but it was good enough. Time travel/body swaps stories will never have a completely satsfying and logical ending. 

I felt the drama has given us a good enough ending. JBH got back to present and his own body. I completely reject that he would have prefered staying as queen, and just to make it clear. I am fully behind the rights of LGBTQ+, and have no issues whatsover with gay love. Some of my all time favourite books and movies are about gay love.

But, I just don't believe that the King would have loved JBH if he was looking at a man. 

So, at the end JBH got what he wanted, but he is now a kinder person because of the queen The King and Queen seemed happy despite the King missing some of that old spark of JBH. The Queen is now more assertive and confident because of JBH influence.

But, again, all that doesn't really matter that much to me. This series is a comedy gold. And SHS performance is one of the best of its kind  I have ever seen in  any language, and I am almost 50.

For me it is certainly happy ending tinged with a bit of wisfulness, but I don't see how we could have a better one.

For all those who want BongHwan to remain in the Queens body, I like to ask you a sincere question.

Would you be willing to go back few hundred years in the wrong body and you have to have sex with someone you like, but of the opposite gender you are attracted to??

BongHwan liked the king, didn't love the king in a romantic way. that was So Young.

I think he is incomparably better off with that end rather than being stuck in a woman body.

Bonghwan suffering from the first part of the series is played for laugh, but if it was taken seriously, then his suffering is massive.

We now support (at least in some part of the world) transgender people because we acknowledge their suffering of being stuck in the wrong body, so imagine adding the time period. How can you say that Bonghwan is better off being stuck in the queens body???

People can get over heartbreaks. He will be fine in modern day.