I have been using XnView MP for a couple of years now, and this rotation problem happens to me quite often.
I take pictures with my iPhone 6 (or iPhone 4, before that), nothing unusual with the settings on the phone. The pictures are 3264 x 2448, typically c. 1.5MB - 2 MB.
I take most of the pics in landscape mode, but maybe 10% of the time I use portrait mode. And maybe half of those portrait-mode pics I change to landscape.
Most of the time when I do that, XnView MP will rotate the image, and when I move on to the next image, it will ask me to save and overwrite the portrait version, and I tell it do that. So all seems okay. But then when I move back to that changed image -- after looking at some more pics that I just uploaded -- it will be in the original portrait mode, as if I hadn't done anything to do. So I rotate and save it again. And maybe this time, it works.
And then -- sometimes -- when I close XnView MP and then run it again, that picture will be back in portrait mode. And I go through the process again.
I wish I could tell you what is different about these portrait pics, but there is nothing I can tell. I was thinking about sending you some, but when I go to verify that a pic won't STAY rotated, after a couple of tries to make sure that the pic really won't STAY that way ... it will, in fact, STAY that way.
I have found that rotating one of these to landscape mode and THEN cropping it, and then saving it, seems to work almost all of the time. But not quite all of the time.
This has been going on for the couple of years that I have been using XnView MP. Obviously, XnView MP is a very nice program, or I would have switched to another photo manager. But saving rotation has been a problem.
As I say, nothing strange. I don't manually alter the EXIF data or do anything technical like that. I get the pics from my phone to the Mac using PhotoSync (https://www.photosync-app.com/home.html
), and the only thing I have that app do, as part of the movement, is rename the photo with the date-and-time.
I am conscientious about having the latest versions of XnView MP, the Mac O/S, and so forth.