That analogy isn’t good because apple doesn’t lose opportunity by charging itself the cut to use the store. There is no indication that apple is limited in how many developers it could take on.
If apple had a limited number of apps and they were declining other apps in lieu of its own, that would be true.
That's not how that works. If you charge $50/hr as a freelance software developer and you work on your own stuff for a day you didn't "get $400 back", you paid $400 in opportunity cost.