So you have 5 years of not paying electricity. For 4 of those you wont be earning anything significant anyway.
Whereas with hardware in hand you'd be delighted to pay more in electricity than it was making for those 4 years?
No, the hardware is most likely useless after the first year. As is the cloud mining contract.
The hardware will have earned more in that first year than the contract will earn in that first year. Since earnings after the first year are negligible the hardware also earns more in the first year than the contract for five years - for the figures given in the example.
After the first year you throw the hardware away, you don't sell it.