a week and 2 engineers
The bug is fairly obvious. I suspect though that the circumstances of the actual execution, and the knock on effects (software gets stuck in a loop) may have been non-obvious. The OP doesn't say whether this whole thing was conditional... i.e. maybe the whole code isn't triggered very often. Or maybe it's triggered by a non-obvious scenario. Imagine this was in the controls of a custard factory machine, and it is part of the nozzle blockage handling routine... Maybe the nozzles don't get blocked very often. Maybe they do but the whole factory gets coated with custard and so diagnosis of what went wrong is 'sticky'. However what it does point to is a lack of automated testing of the software. Which should have found this particular issue quickly... solving it shouldn't take 2 engineers though.
Maybe the engineers were being charged out by the hour ;)
Maybe the first one couldn't work after injuring himself through laughing.