Im using random movement with navigation. I get a random position within a radius
var radius = 3
var random_position = Vector3(rand_range(-radius, radius), 0, rand_range(-radius, radius))
I then use the navigation.getsimplepath(random_position) to calculate the path and move the object to follow such path. I dont evaluate if the position collides with the mesh and the character never leaves the mesh on his movement.
I guess that if you need to evaluate the position you could use a raycast to check if the selected position collides with the navmesh.