One possible solution could be to plot the path of the bot only as far as the battery onboard can get it, if the destination is further than the maximum powered flight distance, find a roboport that is closest to the original direction and fly there instead, recharge and figure next leg of the path. If the bot can't find a path, make it hover next to the last roboport out in the open and send warning message to the player to get their attention. So the player can take care of it.
The advantage would be that there wouldn't be long expensive CPU path calculations, and when things change (roboports get destroyed/removed), there wouldn't be long list of paths what have to be recalculated.
The disadvantage would be that it would be possible for the bots to paint themselves in a corner somewhere.
You could potentially cache the shortest/fastest paths between parts of the map, as the bots discover them, and use them as "flight corridors" to further lessen the amount of paths that need to be calculated fresh for every bot.
I've included save of my small base and a screenshot with the path the bots take indicated by a red arrow. the rail rectangle in southeast corner is where the bots tend to loop.
thanks
