No, because you lock in a dollar amount at the beginning of your mortgage, which doesn’t increase over the lifetime of the loan, especially if it is fixed rate. If you rent, you are covering the costs of their taxes, as well as helping them make a profit off of your rent.
Home ownership protects from inflation risk as well. Over the course of 30 years, how much will your rent increase? Inflation doubled the cost of everything in that period of time, or more. Compare that to a flat mortgage payment. You aren’t protected against increased property taxes, but of course being a renter doesn’t protect you from that.