We use VRP and point to point routing for a web application. One of routes keeps generating a weird result. So, I tested a part of the route on the esri site. It shows the same strange result. On ArcGIS.com it works correctly. But the Javascript SDK for point to point or VRP both do it incorrectly.
https://developers.arcgis.com/javascript/latest/tutorials/find-a-route-and-directions/
I have attached 3 photos. The first shows the problem and the second shows the location and the third shows the same problem correctly solved in ArcGIS online. I suspect this is a systemic problem, where the routing engine thinks, making a right, U Turn and another right is faster than waiting at the intersection with a traffic light then going straight through. So, mathematically, the solution may be optimized, but obviously it is not useful for routing.