As someone who works on zSeries mainframes, I am not sure I agree. For developers, this is true, no doubt. But for organizations, in the cloud your data are locked away in ways they are not on the on-prem mainframe.
Vendor lock-in seems to be similar - you use some middleware, you're locked in.
With mainframe, there is more control over the infrastructure than in cloud. I see our management (I work for MF utilities vendor) constantly wrestle for control over our customer's environment that would be easily given in cloud (e.g. telemetry).
What's also interesting (but slowly changing to the worse), the mainframe infrastructure (z/OS for instance) is quite open to custom modification, IMHO more than cloud (but it depends on type, IaaS/PaaS/SaaS).
Is there that much difference between building your infrastructure in DynamoDB vs using IBM DB/2? To me, they seem to create similar levels of "lock in" and create an equal barrier to switching out to a new system... and if you want your data, you're going to dump it, reformat it, and start over.
Or am I misunderstanding your point?
I think the only problem reside in applications that require longevity. Many apps nowadays get rewritten every now and then (especially front ends and Middleware)
The problem is different for database and core systems.