Gatekeeper/notarization are intended to stop malware, which Unreal Engine is not. Apple may well have a valid business dispute (over another application on another platform), but it's an abuse of the system and control they have to obstruct a Mac owner from running non-malware software on their own computer.
Luckily the court stopped them retaliating in this case, but it gives me reason to be concerned about expansion of the "it's Apple's device and will always act in Apple's interests over the owner's" mentality from iOS towards Mac desktops.
Anyone can sue over unlawful contract terms without needing to breach the contract.
The one finding in Epic’s favor was that Apple violated California’s Unfair Competition law by preventing Epic from linking to an outside payment method.
Plenty of contracts include dubious and outright illegal things, depending on the jurisdiction. I'd say Apple is violating the public trust as they increasingly corner the market in apps and phones.
Apple did threaten to cut off Epic's ability to notarize Unreal Engine[0], until ordered not to by the court[1].
[0]: https://www.macrumors.com/2020/08/17/apple-terminate-epic-de...
[1]: https://www.theverge.com/2020/10/9/21492334/epic-fortnite-ap...