That is not how it works, the 5th is not about refusing to testify to avoid committing a crime, it is about not testifying to crimes you may be under investigation for.
This is the same as forcing a person to testify under oath once given immunity, one cannot refuse to answer by pleading the 5th.
This very issue was decided a long time ago under Brown v. Walker https://supreme.justia.com/cases/federal/us/161/591/
Not that it’s going to happen, but couldn’t a state prosecutor theoretically bring some sort of charge against him?