MODE-1807 - Fixed the validation of residual child definitions

Should be merged in 3.1.x and cherry-picked in master.