When on a horse (and I assume a pig aswell) going in f5 mode on a horse all is fine but when you go back into normal view it turns you and your horse directly south no matter what orientation you were in before.
You can recreate this by going on a tamed horse with a saddle, then facing an orientation that isnt south and going into f5 mode then go back into normal mode.
Linked issues
Comments

Thank you for your report!
We're actually already tracking this issue at MCPE-54715, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki