Thank you both for your comments, and in one of the cases I’d also noticed the hook that was getting called wasn’t get_header and read it should be.
However I didn’t go this route since this issue also happens with plugins we don’t develop, such as the domain mapping one, and probably others.
I don’t think there’s any case in which the W3TC, as it’s working now, should cache the 301/302 and as such opted to deliver the workaround at the W3TC plugin instead of all possible plugins that might have the wrong hook.
The plugins should fix the issue, but W3TC shouldn’t cache responses that will produce issues. 404 already has the exception, 301/302 have caused issues to me and other, but probably anything other then 200 shouldn’t be cached.