D981/rP22345 changed IsInXChecks to use edge-to-edge distance instead of centre-to-edge, which broke UnitMotion's min-range movement, which assumed distance to the center.
Since units are treated square, the diagonal point may be closer to the target than the "real" clearance by a factor √2, so the delta between minimum range and maximum range should be at least (√2 - 1) * clearance to be safe in all situations (this is generally not a problem for regular units which have a clearance of 0.8, but could be one for catapults or elephants). Note that this doesn't actually apply if the min-range is 0.
NB: since the long-range pathfinder brings units to navcell centres, it can in some cases to actually bring the unit in correct range.
This is alleviated by TryGoingStraightToEntity, but moving with point targets might still fail.
This issue explains why whales will sometimes get stuck during roaming, and also why some units may fail to stop from "Moving" state.
However, D1982 makes TryGoingStraightToEntity work with point targets, and D1983 will improve logic to use the short-range pathfinder when we get close to the target and are out of waypoint, which should fix this issue - until the long-range pathfinder's MakeGoalReachable is improved in that respect.