Apparently there's also a concern about the high temperatures reached by the foam while curing. A thread from earlier this year: https://forums.mikeholt.com/threads/update-on-romex-in-spray-foam-insulation.2578873/I would read the spray foam instructions and warning very carefully. Some of these compounds can attack certain types of plastics. Not sure about the NM jacketing.