For this question, let us assume that the only principle we care about in public decision making is majority power: the majority of citizens should be able to do whatever they want. There seems to be an inherent paradox in this principle. For example, suppose that in 2022, the majority of citizens in some country decides to sign a contract with some external entity. In 2023, when it's time to pay, the majority decides to break the contract and not pay. If the contract cannot be enforced, this means that no-one has an incentive to sign contracts with this country. So, the effective power of the majority is greatly reduced - they cannot commit, so no-one will want to sign contracts with them.
The paradox here is that, giving the majority absolute power (including the power to break contracts) greatly reduces the power of majority (the power to have contracts).
A common solution in democratic countries is to give courts the power to enforce contracts, even against the will of the majority. However, this power limits the power of the majority and may be abused to give excessive power to the judges (for example, the judges might interpret the contract in a way that favors themselves or the values they believe in, which might contradict the views of majority).
My question: are there any studies in political theory (or elsewhere) regarding this paradox, and its possible solutions?