Unbelievable...Almost.

I have never heard of a foam designed for, tested for, or listed for the securing of ANYTHING electrical. It may exist, but not in my world.

Read through all the NEC codes about proper mounting and retention, and you'll find a lot of "designed for...", "listed for the use as...", etc.

If anyone knows an inspector that would pass such a thing, I owe you a cold one.