I was getting this exact error mentioned.
In my case, the MacOs update for BigSur + Monterey update, solved the problem like a charm.
After Monterey got installed I could pod install normally with no more errors.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: