Due to the random spawning and map generation of the game, sometimes shrines get spawned in ways that interacting with them breaks for the bot.
One thing you can try is changing in OldRoutine, "if (tries > 10)" to like "if (tries > 3)" to cut down on time spent in that spot trying to interact. Stuck detection for MapBot is just kicking in to cause the exit because there's no way for the routine to tell the logic it's not actually stuck, it's just in the same position for longer than expected.
Another option would be to just disable shrines, but that might cause issues with any mob tracking logic and skeleton/divine shrines.
In terms of trying to fix the issue, one thing that could be done in the future is to not check for object highlighting and just click on the location and see if anything happens. That would probably be the best fix for this game issue, but it requires a number of changes to do, so you'll have to work around it with changes for the shrine interaction itself.