I believe I have found the issue. Ray tracing can be toggled on and off by pressing the semicolon key. This toggle doesn't use any modifier keys to prevent accidental presses.
I am left handed with a mouse and I use a US layout keyboard, so my movement keybinds are mirrored from WASD.
Forward - P
Left - L
Right - Apostrophe
Backwards - Semicolon
So in short, whenever I move backwards, ray tracing gets toggled.
It's just an extremely poorly thought out and lazy keybind choice from Mojang. The ray tracing toggle cannot be remapped, and is not mentioned anywhere in the video settings. It steals keyboard input from keys that are bound to other actions.
So while this is not a bug, this is still something that Mojang needs to fix, since not everyone in the world is right-handed, and it can also be pressed accidentally since it uses no modifier keys. And it's not exactly the most demanding fix in the world.
This isn't a bug, minecarts only bounce off solid blocks, and redstone blocks are transparent.