As the title said, minecarts rotates back instantly when the pitch is set with commands. With the yaw it works fine. This issue is probably a duplicate, but the report I found is "Invalid" and reported years ago.
This could be fixed with a NBT tag. Making the "NoAI" tag useful for the minecarts, or giving a custom tag for the minecarts, like "NoRotation".
Please don't ignore or mark as duplicate, this is an important bug for someone, like me. If any more information needs to be provided, then please let me know in the comments and I'll do it.
Thank you for your report!
We're tracking this issue in MC-165488, so this ticket is being resolved and linked 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:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki