The judiciary is part of the government. Being an independent branch doesn't change that. Government doesn't just mean legislative.
I guess broadly in English you'd say the judges are part of the state, but they're not a part of the Spanish Government.
Nothing here been a "gotcha" but basically Spanish-speaking people using English to communicate Spanish concepts to Americans who also speak English but have different understanding of those concepts. Nothing malicious here, just some good old misunderstandings :)