This issue affects all rail types. In most circumstances, pistons can move rails without issue. However, in some circumstances, notably when rails are sitting on an upward-facing pistons, a rail will break off into item form.
Here's an easy scenario to replicate:
Two rails are connected, one of them sitting on an upward-facing sticky piston, the other rail on any block. Both rails are flat and are at the same height. When the piston is powered, the rail sitting above it gets pushed up one block, then the connected rail converts to a sloped rail. When the piston is depowered, the higher rail is pulled down, and the other converts back to a flat rail. The rails remain intact when the piston is powered and depowered.
However, if the rail (the one not above the piston) receives a block update while the other rail is retracting, it breaks off into item form. Redstone powering or depowering nearby, even two blocks away, can update the rail at the wrong time and cause this issue. Attached pictures show this.
In my experience, this may or may not happen depending on the coordinates or orientation. Most likely because redstone sends block updates differently depending on coordinates. The above example appears to happen regardless of location or orientation.
The other time I see this happen, is when a sloped rail is pulled down by a sticky piston, and there is no rail available for the top to attach to. Rather than convert to a flat rail, it breaks into item form.
Related issues
Attachments
Comments


This has been the case since 1.16 - it breaks our smelter that has a configurable number of furnaces (by having a piston move the rail up to provide a new endpoint after each bank of furnaces). We've just had to adapt to either not using the system or dealing with placing the rails back.
Edit: in our environment this happens 100% of the time, with unpowered rail. From our perspective it seems to be related to any rail connect to movement, not just powered rail.

Relates to MC-2023. Not the same, as this issue doesn't involve ghost blocks.

This needs rephrasing, the rail breaks because the neighboring block to lean at is gone. The same can be observed when moving the ascending rails directly away from a "supporting neighbor" block. The whole reason it works fine when not updated in the meantime is because the moved rail forces the connection, it's not the other way around
The best fix for this is having ascending rail without neighbor support (but with floor support) turn to flat rail instead, upon getting a block update.