I am not sure if it is an issue with version 6.31.4 but when using HMPs I'd recommend setting PH_ITERATIONS to a value >0 to use the iterative physics solver which is more forgiving to contacts in dense environments. It might also help to set TERRAIN_CHUNK to a larger value.