Piping through tee doesn't trigger the sever side detection (it doesn't stop to read every few ms) and using the x flag isn't inherited, so it's gone as soon as subshells are invoked, which is pretty normal for an installation script.
This has all been mentioned in the linked comment thread
This has all been mentioned in the linked comment thread