COVID-19 live updates: Being vaccinated offers better protection than being infected: Study
The study reviewed more than 7,000 people across nine states.
I don't have any specific information or research to back this opinion up but...
My thought is that vaccines are designed to be effective on as broad a range of disease variants as possible while immunity from being infected will be to whatever you had -- and possibly just resistance to that one type.
If it turns out that there is a quality difference between types of immunity the vaccine would likely be better.