It is different from the vendor lock-in that prevents one from migrating from AWS to Google Cloud because all of your code uses their APIs and libraries specifically.
However, the effect is the same, of course. You are locked in! It's not necessarily a bad thing, but this is why you must choose your poison carefully.
This is true, but it's also kind of vendor lock-in because there's a whole query language and aggregation pipeline for Mongo that's completely different to other databases. If I was using an RDBMS and was switching from MySQL to Postgres I think I would likely have a much easier time, because fundamentally it's all SQL (I know, there are differences between Postgres and MySQL, but it's a lot less, and a good ORM will smooth some of it out for you - at least initially)
I think this is basically equivalent to your example of not being able to easily move from AWS to Google Cloud because of their different APIs.
It doesn't seem like SQL-to-Mongo is impossible to implement, because there is third-party tooling for that (which I haven't tried): https://studio3t.com/knowledge-base/articles/sql-query/
I can’t conceptualize a dataset that could survive(/be performant) in a document store, but not a graph.
The effort required just to get your data in a state that's clean enough to consider moving to the RDBMS you should have started with can be overwhelming.
Then you have to rewrite your queries out of their custom query language.
Is it Mongo's fault you made a mess in your database? No, of course not. And their dashboard is actually pretty nice. But you are massively locked-in.
Source: own a production Mongo DB with years of accumulated mess in it. Desperate to get off it. Paying customer of Mongo's hosting (it's one less Mongo thing to deal with, at least).
[0] There is schema support now, but it's only JSON schema and it's relatively new in the scheme [sorry] of things