Pics: Sorry for night, but it's clear enough.


Video link of proof in action that shows the build order:
https://youtu.be/sI7n71ta1hc
In the video you can also see another bug where the shadow of the leftmost gate is shifted a tile to the left when it is on top of a rail.
This is a very minor bug, and I don't mind if it is not fixed.