According to Fubini's Theorem we may (under "normal" circumstances) assert that:
$$ \int_{X \times Y} f(x, y) \mathrm{d}(x, y)=\int_{X}\left(\int_{Y} f(x, y) \mathrm{d} y\right) \mathrm{d} x=\int_{Y}\left(\int_{X} f(x, y) \mathrm{d} x\right) \mathrm{d} y $$
which, when applied in the context of function multiplication within the integrand presumably implies:
$$ \int_Y \left ( \int_X f(x) \mathrm{d}x \right) g(y) \mathrm{d}y = \int_X \left( \int_Y g(y) \mathrm{d}y \right) f(x) \mathrm{d}x $$
Problem: Apparently (see below) this is not the case if we insert an unbounded linear operator into the integrand:
$$ \int_Y \left ( \int_X U(f(x)) \mathrm{d}x \right) g(y) \mathrm{d}y = \int_X \left( \int_Y g(y) \mathrm{d}y \right) U(f(x)) \mathrm{d}x \color{red}{\text{ (fails to hold)}} $$
where the condition for linear operator $L$ to be unbounded is that there does not exist some $M \ge 0$ such that for all vectors $x$
$$ \|Lx\| \leq M \|x\|,\, $$
But is this true? And if so, why?
Context. This question arose as the result of another question from the area of quantum mechanics (which I offered 2 bounties on, but never felt I got a satisfactory answer). A couple of the answers offered asserted the result above, but I didn't feel were given any sort of justification, so I'm trying to understand with a new post.