Not anymore in the EU. Check the DSA - it applies to the largest online platforms and prohibits them from doing what you just said. I was unjustly banned from Reddit for using a third party client with my own API key – all following the ToS. I was flagged as a bot (I suspect) and permabanned with zero warning and recourse. Appeals unanswered for weeks, even got ahold of an admin directly in comments in a support thread (using another account) who looked into it and said there's nothing they can do, account is not restorable.
I then complained under DSA, to their dedicated DSA address, as I live in the EU: unbanned almost right away, all fully restorable after all. Haven't had any problems since.
Google falls under the same act, so what you said is only true outside the EU.
Is DSA the same thing as GDPR Article 22?