Hi,
fungus gnats can be really annoying. First, try keeping the substrate a bit drier, especially at the top they prefer it moist. Then of course, always use nematodes, and never throw away the runoff! Instead, give it to the plants or use it to inoculate other ones.
Also, use yellow sticky traps.
If the problem persists, try covering the top layer of soil with sand that almost always works really well.