Hobbes has a solution to this problem

Text by professor Timo Airaksinen
Divinely authorized laws may go against the laws of nature. In such cases we may not obey (positive case) or we must not obey (negative case). Hobbes has a solution to this problem: we must always follow the sovereign's will without thinking of the laws of nature because he is authorized to say what is right, which is to say that interpretations of the divine law depend of him. If an individual says she follows God's law rather than the prince's orders, she refers to her own conscience, and she is therefore personally responsible for the current interpretation of the law in question. This is too subjective a method to warrant any trust. Only the sovereign can interpret the laws of nature in specific cases, and this prevents conflicts, says Hobbes. This solves problem of divided loyalties: natural law and the prince's law always agree.
When we disobey the will of the prince, we also risk rebelling against God in the sense that we wilfully overthrow His laws, especially the key virtue of loyalty. At the same time, we of course may rebel against our own self because we overthrow our own reason and principle of moral life that are "stamped on the mind" (PO 12), replacing them with a sensuous, feeling self. Any act of disloyalty is a much more serious wrong than one may realize – this is Berkeley's main message in PO. It claims that we all too readily take into our own hands the power that belongs to the prince as the supreme power. And this may include the subjective reading of his laws and orders. Individual conscience is not always a reliable guide although in some positive cases we should trust it.