LPS-42895

LPS-42895 Fix deletion order of groups