I did an extensive cost analysis of a 1MW datacenter vs Cloud 10 years or so ago, so this stale data but take it as an anecdote. Accounting for the lease, facillity equipment (UPS, STS, CRACs, generator, fuel, raised flooring, cabinets, BMS, etc), compute equipment (PDUs, servers, spare parts), facilities and technical staff, the costs for AWS were substantially cheaper.
The trick is you need skills, most of which are not in demand anymore and difficult to fill. If you pretend like you can hire and manage: the results are clear.
There are opex/capex aspects which I don't understand, I amortized servers with an average server lifetime of 3 years.
It's easier for most people to spend money with one vendor, though, and that's where AWS/GCP makes sense.