A minor pathfinding error. I see footmen waking up from their sleep and moving back and forth from their bed to going outside the door when enemies were within their aggro range. But they were able to pathfind their way towards their enemy anyways.
The enemy was at least a few yards between my men and them, and behind a wall when they woke up from sleeping.