It's not illegal however if you signed a contract to that effect, which is what you did when you started using the platform.
A better analogy is that you're renting some furniture and the furniture is found to be unsafe. The company can come and take it away, either replacing it with something else or refunding you.
In the software world nobody but the creators or IP holders of the software actually owns the software. They just provide you the license to use it.
It's illegal in many countries to modify the software so if you had a closed-source word processing application it would be illegal to mod it or to use it as part of a data transformation pipeline. You can only use it for the purposes stated when you bought it.
If there was a way to limit your oven to bake recipes the manufacturer allowed or to use specific approved ingredients, and would come with some sort of value-add to make consumers ignore that as a problem, I'm sure someone would actually do this.
(please note that I am stating facts as I see them and not necessarily agreeing with the state of affairs)