When the player is riding a entity that is being teleported to be rotated as the player, causes the players view to move to straight down or straight up.
When it starts while looking slightly down it goes straight down.
When it starts while looking slightly up it goes straight up.
How to replicate:
1. get repeating command block.
2. place command: `execute as @e[type=horse] at @s on passengers rotated as @s on vehicle run tp @s ^ ^ ^ ~ ~` in command block and set to always active.
3. run in chat `/summon horse ~ ~ ~` or use a spawnegg.
4. ride the horse.
The effect does not happen when you remove the "rotated as @s" from the command or use another entity as a selector(example: "rotated as @n[type=villager]")
When you teleport the horse so that it rotates to a different direction, the player riding it will also change the direction it's facing relative to the horse. If you run the command from step 2 once yourself instead of putting it in a repeating command block, you will notice that when the horse changes direction, you change direction with it. So naturally, putting this command in a repeating command block will eventually force you to keep looking straight up or down based on where you were looking before you mounted the horse. There is no bug here.