This is a common misconception. The following animation provided by OSRM’s creator illustrates how routers generally deal with the situation in which you’re surrounded by inaccessible paths. If your starting point lies within the island, you aren’t trapped on the island. This is important for serving origins or destinations within gated compounds, for instance.
Anyways, I was responding to your point about turn restrictions, not access restrictions. The conservative approach is always to err on the side of honoring a restriction. A pathological case involving access restrictions and turn restrictions could conceivably truncate the route and otherwise make the route worse. But that’s less severe than some of the possible worst-case scenarios when ignoring one-way restrictions, especially in less urban environments, where such restrictions would be more notable and the consequences less predictable.