The gas-filled bubbles that give foam its cellular structure are durable if not stressed. But when pipes and wires air-sealed with canned foam are forcibly moved, these bubbles are easily torn apart.
Air- Sealing Without Foam
To evaluate the air-sealing effectiveness of two tapes and 22 caulks and sealants ...
Air- Sealing Without Foam
... the author applied multiple samples to test boards assembled from plywood, framing lumber, and sections of nonmetallic sheathed cable.
Air- Sealing Without Foam
Caulks that failed the wire-movement tests typically remained bonded to the plywood but separated visibly from the outer sheathing of the cable.