That's an interesting problem

I would also love to have mechanics navigate habitats. But I have found a workaround (but there might not be enough space in the habitat in the screenshot for the workaround to fit).
You can place paths through habitats! Just not through the habitat door. Make a part of the wall out of null fence, place a staff path through there, continue the path inside of the habitat (the path can enter and exit the habitat as often as you want) to the generator. But now the animals can escape through the null fence where the path enters or exits. To fix that, use rocks, walls (architecture pieces), decorations, etc. For something kinda realistic you could use a curtain of ropes or a wall with decorative doors on both sides. For larger animals a wall with a door could even work. These things have hitboxes so they prevent animals from walking through them, but these hitboxes get ignored by staff (and visitors) while they walk on paths. Use the navigable terrain heatmap to check.
Notes:
You still need a habitat door for the zookeeper. The habitat door is the only way for a zookeeper to leave a path or walk back onto a path. Even if the zookeeper is on a path inside the habitat, they will walk on the path to the door to enter the habitat again to care for the animals. And when the zookeeper is walking off the path inside the habitat, the hitboxes of architecture pieces, rocks, etc. apply to the zookeeper. So the zookeeper can't use this path to exit and re-enter the habitat (unless the animals in the habitat are so big that you can place vertical bars with enough space between them for the zookeeper but then the baby animals could fit through them). But the zookeeper can just walk over the path that's inside the habitat, but they can't properly enter the path without going through the habitat door.
I've also tested that mechanics, etc (including protestors) just walk though a lion habitat, so the "guests can enter habitat" info in the zoopedia really only applies to guests.
Staff will also walk through a habitat with such a path to get to another habitat, or anything else outside of the habitat. All three generators in the screenshot were accessible to mechanics.
I hope you understand what I mean.