It seems that rails controlled by a flipflop are bugged (unless this is intended?). When the flipflop is on (rail switches to point up in this example) the attached entity undocks, but when the not is on, it works as intended. Adding a button between the flipflop and rail functions as a work around.