I get that you’re using unbounded scrolling but if the map is fixed you could just put the whole thing within the layout bounds.
Since you’re doing it for control you could replicate obstacles on screen to the layout bounds, do pathfinding there and just move the player from that. You just have to deal with the offset from the screen to the layout bounds. Bear in mind pathfinding will be done with only partial knowledge of the map. Guess this is similar to shifting things around to make the on screen stuff be on the layout.
Third option could be rolling your own pathfinder. The pro of that is more control. The con is more work to make it match what the behavior does.
One idea could be using Dijkstra's algorithm from the player’s position to the target. Instead of a 2d array of the cells you could do a sparse array with xy pairs as keys for cells. Or you could use astar. The idea is we have more options for how we define the graph of walkable nodes. The behavior uses a 2d grid of cells within the layout bounds. What i mentioned above is a sparse 2d grid of cells with no bounds. Beyond that there’s navmeshes or similar stuff.
If your obstacles are mostly convex then you can get decent pathfinding with raycasts and wall following.
Kinda just throwing a bunch of ideas out there.