Exactly. It's far better to get rejected early from the PhD track, for not being a high achiever, than to muddle through unable to secure a job. You would still be able to prove yourself in a masters degree.
There is such a lack of permanent research positions compared to postdocs and PhD students that I'm not even sure it's selecting for the best people.