Is it mandatory to have same code version on the MM and MD controllers which has 8.x code?
It's NOT mandatory to have same code version running on MM and MD controllers.
However the MM should have higher code (126.96.36.199) and all other MDs can have (188.8.131.52) code. But the controllers which are in Cluster members should have the same code version. Only then Cluster hitless failover will happen smoothly.