Ratified treaties are legally binding. But, state sovereignty will always be a lever to pull to allow states to disregard or compromise their obligations (although not always legally).
What occasions would allow states to use 'state sovereignty' as a lever to disregard or remove their legal obligations? Unless you are including those occasions where a state properly exercises its right to withdraw from a treaty in accordance with the treaty's withdrawal terms (not really thought of too much as an issue of 'state sovereignty'), the short legal answer to that is no occasions whatsoever. The fundamental problem in suggesting that 'state sovereignty'
may operate to remove or diminish existing legal obligations is that it assumes, quite falsely, that 'state sovereignty' is a legal principle or rule with legal operation rather than a mere concept, which is ultimately what it is. That is, state sovereignty is merely the idea that states should have exclusive power to rule (largely by way of making laws) its territory and the population therein. So, an apartheid state which willingly entered into a legal treaty to end legal segregation and all racist policies would be legally bound to do so under international law - the fact that it later refuses to do so does not detract from the existence of that international legal obligation; it just means that the state has chosen to exercise its sovereignty in a way inconsistent with its legal obligation, thereby
acting in violation of international law. State sovereignty does not in any shape or form absolve, even theoretically/normatively, a state of an obligation which it has willingly sought to undertake in the first place.
The point is, despite being legally binding, it doesn't mean countries will abide by it.
But the converse of this is also true, and perhaps more relevant: the fact that countries do not abide by their legal obligations does not make them any less legally binding.
This is why in HSC questions we often see "Explain how state sovereignty compromises the effectiveness of multilateral cooperation?" or questions to that effect.
The nub of such questions is simply for students to explain that only states themselves can decide which treaties/initiatives they wish to participate and ratify and hence it is often difficult to reach an effective consensus over international issues given that each state is ultimately dictated by its own unique circumstances and political interests. A second possible point is that even after ratifying a treaty and
incurring legal obligations, the concept of state sovereignty means that it should generally be for the state and the state itself to implement those legal obligations in good faith, especially if those obligations entail making or changing domestic laws, rather than through the intervention of other entities or states. But I suspect the realistic view, and indeed the predominant academic view, is that states are left to implement their obligations on their own not so much because of this much-quoted sanctity of 'state sovereignty', rather, because there is no effective way of forcing them to do so. That is, and unlike a domestic legal system, there is no international police force to hold them (especially powerful states) to account.