Can Hamiltonian MCMC be used effectively if the likelihood is identically zero for some parameters?

If the density really is -inf at some point, then I don’t think HMC will work properly. I’m pretty sure a posterior like that breaks some assumptions. (whether or not it might still give you something useful is a different question that I don’t know the answer to, or ever really how I’d go about answering it…).

But maybe you can instead approximate this, by making sure the density just becomes small enough? I wouldn’t be surprised if that still leads to a pretty nasty posterior geometry though.
If so, it might be worth trying out the normalizing flow adaptation (nf-adapt – Nutpie), but keep in mind, that that’s still a bit experimental.