If the connected edges on a switch are long and not straight, it's possible that the function calc_anschluss_of_all_nodes calculates the angles between the edges wrong.
Possible fix: Use the next geo- instead of the top node from the signal. It needs #40, therefore.