You can duplicate this at home with large shopping or garbage bags and Great Stuff foam insulation;
That being a local trade name I don't know if you're talking about one of the one part foams in a can, or two part foam.
The one part foams in a can be very variable in performance. They rely on atmospheric moisture to cure them, and if you're building up great wads of foam it can be too thick to cure as quickly as you'd like, or at all if you're really unlucky. I've had very hit and miss results using them in the way you describe.
Two part foam is much much better, it actively expands from a liquid to a foam as it reacts and cures quickly, sometimes a little too quickly. The drawback with two part foam is that (1) it can get very messy if you're not careful, (2) if you're over enthusiastic about how much to use it can try and burst out of the box, (3) the free iso-cyanates in it before it cures (it's fine once cured) are a respiratory hazard, especially to people sensitive to them, asthmatics and people with other respiratory conditions - definitely something to mix outdoors, standing upwind of all the gubbins, wearing a respirator.
You can get the two part foam pre-packaged in sealed bin-bag like bags, you crack an internal seal and squish them about a bit and the thing inflates in your hands. This cuts out all the hazard stuff but they're chuffing expensive. The brand name of the brand leader escapes me at the moment, but sometimes if you're lucky you can find the pre-packs at a discount on eBay.