How to prevent that tho? Everything seems to be at the risk of either the first or the second...
You don't protect against tyranny of the majority by allowing minorities to dictate policy, that's just regular tyranny.
You protect against majorities by requiring supermajorities for all the most important functions of government: constitutional change, impeachment, and censure.