In the United States it usually is not. Most of the alarming material online describes the UK, where lenders and surveyors raised specific objections. What does transfer here is narrower: an inspector who cannot see the roof sheathing will say so, and undocumented work unsettles buyers.
More detail
This question deserves a straight answer, because the search results are genuinely misleading. The reason it looks alarming. A large share of the material online describes the UK housing market, where mortgage lenders and surveyors raised objections to foam applied to roof timbers, some homes were declined for lending, and a wave of poor installs sold through grant schemes made it worse. That is a real situation and it is not the American mortgage market. US lenders do not decline conventional financing over a foamed attic. What does carry over, and it is worth taking seriously. A foamed roof deck is an unvented assembly, so a home inspector cannot see the underside of the sheathing to check for leaks or rot. A competent inspector will write exactly that in the report, and a buyer reading "unable to inspect" without any explanation next to it fills in the blank themselves. Undocumented work compounds it: if nobody can say what product was used, at what thickness, by whom, or when, the buyer prices the uncertainty rather than the insulation. What solves it, and it is inexpensive. Keep the contract, the product data sheets, the specified thickness and R-value by area, the installer name and credentials, and any warranty, and hand the package to the listing agent the way you would a new roof or furnace. Photograph the sheathing before the foam goes on. If you have a year of utility bills either side of the work, include those too. The local reality in Greater Columbus and Central Ohio: documented envelope work is still uncommon enough here that most buyers have not formed an opinion about it. That cuts both ways. It means there is little prejudice to overcome, and it means the burden of explaining what they are looking at falls on the seller. A one-page summary in the listing file does that job.