Living in a present-day million-dollar home for a net cost of $500k over 30 years is a great deal. That’s a little over $1000/month on average. Where can you even rent an apartment at that price these days?
Also there are a ton of tax deductions that were left out of your calculation. PMI, mortgage interest, even certain types of maintenance are tax deductible. Not to mention green energy upgrades, depending on where you live.
Those sound small but would probably be enough to flip your -500k calculation into a significant positive over 30 years.