The App Store isn't a contract, but it is (or should be) quite a bit better than building your app on top of some open API that you have no assurances on, as the rules are published.
The problem is that there's no real introspection as to how the rules are applied, and not way to really appeal a decision and expect to influence the result, so the closest thing to a contract in this case is completely one sided.
Part of me wonders if the fact they charge for developer accounts means they might be liable in some way (although I'm sure this approach has been explored in the past), but Apple has deep enough pockets they could probably just refund every Developer the $99 and not bat an eye. If it affected the revenues they collected as their cut though... going after that money could really make a big dent if it was a class action (again, not sure this is even feasible under the law).
You do need to realize that this can change fairly quickly, so you should either use this as a springboard to something else, or just accept that it's a temporary business and not something that will stick around.
The concept still applies even if the problem isn't about being kicked out (which a contract could maybe solve), but simply about the market fading for one reason or another. One common thing that can happen is that the platform provider may decide to compete with you, which is often very hard to come back from - they usually have access to the platform in ways you can't replicate.
Perhaps this risk is not justified but that's a moral and legal issue not a business one.
This point is made frequently, and it's generally true. But, at the same time, every business is built on top of some kind of opportunity and there is no guarantee in life that opportunities are perpetual.
The mine runs out of ore. People stop buying records. The fish stop biting. The tax code changes. A foreign competitor appears with access to better resources. An invention instantly makes yours out of date. People stop eating out.
I don't think the answer is to avoid all possible opportunities that may not last forever. Instead, you just have to factor that into your business plan. That can mean diversifying, pivoting, or simply acknowledging that that particular business has run its course.