Need help here, impossible to find steady state

Hi all,
I am trying to Replicate the Trade Wedges, Inventories, and International Business
Cycles, AKM(2013). But with two goods, roundabout production and input output structure. My code can not go through. When I update M which is production in the steady state calculation with market clearing, then the production function can not clear. If I do it the other way, Wedgeshocks.rar (7.8 KB) market clearing won’t clear. I am very confused. Can some one help me? Thank you so much.

Best Regards,
ChengyuanWedgeshocks.rar (7.8 KB)