I have used foam from aerosol cans for a lot of different things, rocketry included, and I have never seen problems even remotely close to the comments posted above.
Years ago I used hardware-store canned foam (supposed to be for weather-sealing and insulation) in a 4 inch NC. It cured just fine. It cured fully, overnight, plenty hard enough to lock in a BT50 center tube I put up the middle. I have had similar results every time I have used it. Oh yeah, it works great between 2x4s around windows and doors, too.
I have used canned foam on many projects, home-building among them, and have never seen the stuff require more than a few hours to cure no matter what kind of cavity it was placed in. Occasionally the canned foam (inside a large cavity) will even begin to "skin over" on the outer surface before it expands to fill the space.
I think the canned stuff is cheaper if you only have one little job. You can buy a can for like $3-4 locally, same day. You don't have to mail-order a gallon-sized jug. OTOH, if you are doing LOTS of foaming, the two-part foam is probably more economical than buying dozens of cans of canned foam.
What I can complain about is that it is difficult to guesstimate how much it will expand, and the expanded foam squirts out of any available hole, and it sticks to EVERYTHING (normally a good thing), and it doesn't clean off easily.
The two-part foams are probably better. They probably expand more predictably. You can mix a little of the stuff and save the rest (whereas the canned stuff is pretty much shot after you "open" the can, no matter how much you use). From what I have seen of two-part foams that other people have used, it seems to foam up with a more uniform density.
Two-part foams appear to be a bit more expensive. They are usually not as easy to find as the hardware-store canned stuff (and if you need it today, not next week, that may make a difference for you).
And from what I have seen, both of them are open-celled foam.