[TIMOB-12037] 3_0_X Ensure size and position flags are cleared on layout

Cherry Pick PR #3652 into 3_0_X