How to use UNavigationSystem::FindPathToLocationSynchronously for an AI to detect if a location is reachable taking the nav query filter into consideration as well?

I am trying to use UNavigationSystem::FindPathToLocationSynchronously to see if a location is reachable for my NPC.

My NPC has a NavQueryFilter which excludes the water NavArea so if a location is in the water area I expect this function to return a partial path but it doesn’t.

This is how I used it.

UNavigationPath* NavPath = UNavigationSystem::FindPathToLocationSynchronously(GetWorld(), PathStart, Location, NULL, GetDefaultNavigationFilterClass());

Can I get an example of how to use this? Thanks