If you put a NavMeshAgent component on a GameObject (player, NPC, enemy) it must never leave the NavMesh.
1) open NavMesh window
2) make sure everything you want collision with (walls, tables, chairs, the floor) is marked as Static.
3) Bake NavMesh
4) Ensure anything with a NavMeshAgent component is standing on it.