So, as Jaxad0127 pointed out on IRC, the problem is in `get_path_lenght`, which treats source and destination coordinates in different units.