I'm not sure if this is the case with that specific building which contains the chest but if you check for and x and y coordinates but not z and your player ends up standing on those exact coordinates but on ground floor the bot will get stuck. I generally compare the whole position of an object as that's 100% accurate and will not produce such bugs. The following code should work:
if (myPosition() != new Position(2672, 3301, 1)) {
state = "Walking to spot";
walking.webWalk(new Position(2672, 3301, 1));
}