I know of a house that was for sale for $800,000 in my area that used open cell spray foam on the roof that hasn't been able to sell because the foam is holding so much moisture that it's rotting out the roof. The house is only a couple years old, but the shingles look like they are at the end of their life. It's really bad.
I've seen a few metal buildings with open cell foam insulation that are visibly rusting on the outside. They need to have the foam removed, but haven't done so yet and they are trying to find an option to the moisture issues caused by the foam.
I've never seen an issue with closed cell foam on a house or metal building.
I personally prefer fiberglass insulation over foam because of the price, but I'll be using closed cell foam on the ceiling of my great room when I'm ready to insulate it. My reasoning for spending the extra money is that it's the only way I'll be able to get the R Value I want with a limited amount of space. The isn't going to be an attic, just the thickness of my trusses and purlins for a total of 7 inches.
If I was going to insulate a metal building, and I had a limited budget, I would fiberglass the walls, and try to put a ceiling on it so I could blow in fiberglass in an attic. Using metal R panels for a ceiling allows you to go 4 feet for your joists without any issues. If that wasn't possible, then closed cell foam as thick as you can afford would be the only other good option. I don't see any advantage in cost by buying sheets of foam and trying to fit them into place. You still need to buy cans of foam to fill the gaps and tape all the seams. The YouTube versions that I've seen of this being done convinced me that it's not a good option.