It works because the stochastic node becomes a static value during the evaluation of logprob, but you are right it is not currently working in v4 because we are checking them here: pymc/logprob.py at c8db06b125b1bde286cc00298239980a807d26fa · pymc-devs/pymc · GitHub. Maybe it is easier to do with aeppl.
The custom step method will work for sure by returning a random sample from a fix distribution.