[mcs] Fix error reporting propagation for loop statements. Fixes #20034