Yes, functions have to be reusable arbitrarily often and behave exactly identically
This is essentially the same as this answer but it requires that subsequent calls of the function are 100% indistinguishable, even if the spec leaves some leeway in behaviour.
(Note that in the case of random challenges, the randomness and its distribution are part of the behaviour.)