The issue seems to be with when It.IsAny() gets evaluated. With the 2 tests that pass, it's getting evaluated inside of Setup(...), which works fine. In the first 2 tests that fail, it's getting evaluated outside the scope of Setup(...), so it fails to evaluate correctly. What's probably getting stored in your variable is the result of It.IsAny(), which will be the default value for an int (0).
I don't know the exact reason why the last test would fail, but it could be either that as an optimization your static Func gets evaluated before Setup(...) executes, or it could be that it gets evaluated after Setup(...), but either way it's happening outside of Setup(...).