Foliage generates under static mesh surface when using the fill tool

Anyone knows how to solve this issue. The foliage mesh some of the instances go below the mesh surface at certain slope angles.
3xc2

3xc

Pls, ignore grass mesh, just instance placeholder to demonstrate the issue. I am using ue5.