Consider the following scenario: Witness (not defendant) asked to testify at a civil case at a state court. Witness takes the fifth out of nowhere, that is at a completely unexpected place in testimony where it appears there is nothing even remotely connected to the case could possibly result in a fifth amendment, with the obvious conclusion that the fifth amendment is being taken for something the court doesn't even know about yet. The state grants immunity from prosecution to get testimony.
But the crime covered by the fifth amendment is a federal crime and the state granted immunity.
Is the fifth amendment protection broken, or did the state just bind the federal government to not prosecute something?
I am aware that the state usually doesn't grant blanket immunity (all possible charges revealed by testimony rather than a list beforehand), but if they are intent on compelling testimony and they don't know what the crime being covered is, and they have no way to find out ...
Perhaps there's a way to invoke the fifth in such a manner as to get immunity from the right court, but there is no documentation readily available on the matter. But in that case we have to consider what happens of the federal court refuses to grant immunity. Hint: if the state is a party to a civil case they're likely to grant immunity, but why would a federal judge care?