Holy shit. Glad that this person got managed out... eventually.
A good manager would not say stuff like that unless he really felt the person would take it the right way. A bad manager will say stuff like that to stroke his own ego.
So those are absolutely different sorts of relationships. The coach is not your superior so it changes everything about what they could say to you and the consequences it could have on you.
So no, a good manager should never say stuff like that. It's the sort of words that can be the involuntary sparkle which could ignite depression or even suicide. And for what ? A better performance at writing crud programs ? No. Professional things are not important enough to say any of this.
Not sure if it was meant to be a good job, or a "you're lucky."
Or is it something else?
My skip-level at my first MAAAM job used to snipe at me when I was a new hire. He told me to my face he "would not have chosen me" and "didn't know how I got in." It made me so angry it was all I could do to hold my tongue until I got the fuck out of his office. But I went on to become very successful there, and he eventually had no choice politically but to support me. He got managed out a couple of years later.