The mistake was not in replacing Gamelin, but in replacing him
too late; he had already completely lost control of the situation by the time he was relieved of command.
For the really optimum outcome the time to replace him would have been about 1933.
You are correct that Weygand was a rediculous choice as his replacement.