The Bug
Pushing and pulling a minecart rail simultaneously with the block it's on will cause the rail to break once the extension/retraction has completed. This holds true for normal rails, powered rails, and detector rails.
Note:
A ghost rail can also be created in this setup when the rail breaks (see MC-75716).
The directional randomness in the described setup has been fixed with the 24w33 redstone experiment. The lever closer to the piston is now consistently is the one which causes the rail to break. The rail breaking is the only remaining bug here with the experiment enabled.
Related issues
is duplicated by
relates to
Attachments
Comments


If you put the rail and the block underneath it on an ABBA circuit, it works (push block first and then rail to extend, pull rail first then block to retract). I agree that it shouldn't be that way, and you should be able to push them both at the same time, but that is a currently working fix (used that for my toggleable destination train station).

Confirmed in 13w03a. Really want my train station to work again.

Confirmed in 13w04a.

Confirmed in 13w05b and 13w06a.

Confirmed in 13w09b.

Confirmed in 1.5.

Affects beta 14x03b. When retracting the rails, all are broken. When pushing the rails, all are broken, but the visual of the rail typically remains (you get the rail back but it looks like it is there; when you place a minecart on it, both the rail and the minecart disappear).

Confirmed to still be an issue in 1.8.1pre3.

Reopened, Thanks.

Confirmed for 1.10.1.

Confirmed for 1.13 & 18w30b.

Confirmed for 18w31a.

Confirmed for 18w32a.

Confirmed for 18w33a.

Confirmed for 1.13.1.

Confirmed for 1.13.2-pre2.

Does not appear to happen anymore in 18w48a. Might have been fixed earlier.

Did you push with the block it's on?

Pushed both the rails plus the block that supports it, yes.

It's different now (18w48a), but definitely not fixed: Pushing a rail and the block it's on sideways together (or a diagonal rail and the block it's leaned on) drops it, but the rail is still there visually (ghost block).
Up/down movement seems to be completely fine.

Please show picture of what you're doing where it drops the rail, as I cannot reproduce.
I've tried all orientations and positioning I could think of that would follow the rule "rail and the block it is attached to". The only way my rails drops is when I push the block below it but not the rail itself.

OBS isn't properly set up yet, so the file is too big for an attachment: https://drive.google.com/open?id=1BV3xRXw_iAclGNIPndg9hTU8eo0oz0i3

Apparently the sharing setting wasn't correct before. Should be fixed now, everyone should be able to view the file.

Thanks. I've summarized your and my findings in one hopefully more convenient screenshot. (as of screenshot, in 18w48b)
[media]
I think the problem is more complicated or incomplete from above observations.
I tested the same configuration in four different mirrored orientations (more exist even!), and the problem doesn't happen consistently. Observe the piston orientations and each lever. Red blocks lead to dropped rails, green ones don't.
[media]
Confirmed for 18w49a, the above conclusions still apply

Confirmed for 18w50a, as above

Confirmed for 19w02a

Confirmed for 19w03a

Confirmed for 19w03b

Confirmed for 19w03c

Comfirmed for 19w04a

Confirmed for 19w04b and 19w05a

Comfirmed for 19w06a

Confirmed for 19w07a

Confirmed for 19w09a

Confirmed for 19w11a

Confirmed for 19w11b

Confirmed for 19w12a

Confirmed for 19w12b

Confirmed for 19w13a

Confirmed for 19w13b

Confirmed for 19w14a

Confirmed for 19w14b

Confirmed for 1.14 pre-1

Confirmed for 1.14 pre-2

Confirmed for 1.14 pre-3

Confirmed for 1.14 pre-4

Confirmed for 1.14 pre-5

Confirmed for 1.14

Confirmed for 1.14.1 pre-1

Confirmed for 1.14.1 pre-2

Confirmed for 1.14.1

Confirmed in 1.16-pre3.

Confirmed in 1.16-pre5.

Confirmed in 1.16-pre6.

Confirmed in 1.16-pre7.

I've rotated and mirrored the exact same structure in all directions now, and the results of whether the rail breaks and leaves a ghost block (red) or behaves normally (green) is consistent and seems directional. I can't figure out exactly how or why, but this is what it does:
[media]
So just to clarify what is actually happening here. It's not random or sometimes happens.
It's redstone update order.
All you need to create this bug is have the power source update the bottom piston before the top piston. It's that simple!
What's a reliable way to do this you may ask?
[media]
Can confirm in 1.19-rc2

This could be fixed by postponing the rail's check for a block beneath it till the next tick (ie in the code check for unsupported rails BEFORE performing piston pushes, this would delay rail check to the next tick)

Can confirm in 1.19.3 and 23w04a

Can confirm in 23w05a

Can confirm in 23w06a

Can confirm in 1.20.1
The rail breaking and leaving behind a 'ghost rail' still exists, but the directional randomness of the issue is fixed with the 24w33a redstone experiment:
[media]
The lever 'closer' to the pistons will always be the one to result in a ghost rail being created/the rail breaking. I've added the 'experimental_redstone_fixed' label indicating that the randomness is fixed, however the behavior of MC-75716 still exists.