Treaties on embassies are generally concerned with the relationship between the host nation and the embassies that they invite - and any consequences (other than reputation) are generally bilateral; if you violate embassies, then the other party withdraws their embassy, if your embassy acts badly, then the embassy gets expelled.
And even in that case it's kind of common, well accepted practice to use embassies for spying on the host country. There are boundaries on what's acceptable (violations of which will have a diplomatic response or expelling all the involved and perhaps some random personnel), but nobody's really shocked if they happen to find that half of embassy stuff are there mostly for espionage tasks.
"International law" is not really equivalent in practice to ordinary law (which generally has the state monopoly on violence backing and enforcing it), it's more like countries have voluntarily agreed that it seems best that they should follow a particular set of practices. But they aren't required to - the main driver is that if you violate some norms, then others are likely to violate these norms against you. A treaty doesn't stop a country from doing something, a treaty is an indication that the involved countries believe that it's in their best interest if they all avoid doing that... but they'll be able to withdraw from that treaty (either legally, or in practice by simply doing the 'prohibited' thing) whenever they think it's best.