I think I'd already killed the enemies on my way by then, at least in my recent playthroughs, so might not have noticed. But sometimes there are triggering events in the games that'll cause enemies to appear, or I guess disappear. Makes sense they'd disappear when you're on your way to a boss battle I suppose. Rather nice of them! Honestly, the creators probably just wanted you to focus on finding your way to the boss and not receive a beating on your way there. If I'm remembering correctly, some music kicks in when you get the artifact as well, so they were probably trying to set the mood and monster encounters would just break that up.
Then again, maybe it was just a glitch?
I guess I'm not that much help. This is probably one of those things where "Don't question it, just be thankful!" applies.