Do you still have matches in which to experiment? Don't move the players too much, we know in 5-2-3, 2 MCs are illegal, but wide AMs aren't. Next, try wide Ms (ML and MR) or 2 AMCs.
I believe one of them will be illegal. If wide Ms are illegal, then somehow it's playing the 2 midfielders in the middle row that makes the formation illegal. If AMCs are illegal, then for some reason, the 2 midfielders must be on the wings.