It's rare for the best coaches to have been the elite practitioners of a sport. What's very common is for someone who struggled to even break into the elite league or had a very short career there goes on to work through the coaching ranks and become an elite coach.
I have always thought it's due to mid-tier players needing to really focus on every lesson they get, studying every drill, obsessing over every piece of advice they get. Elite players just absorb the drills and lessons into who they are and forget it was ever taught to them in the first place. When the learning comes hard the player will understand the complete process to come to understanding. They will also see the elite players around them apply the lesson and improve, so they know the lesson works. Being worse at doing the skill can ultimately make you better at teaching it because you are forced to understand the skill more deeply.
Being a replacement-level player doesn't automatically make you great coaching material though, that's where the filtering starts to find great teachers and communicators. As many others have commented, teaching is a skill unto itself, one not everyone has.