As mentioned the foam will fall apart from sunlight. A simple coat of UV stable latex paint will stop this.
The two part closed cell foam will not absorb water, but will leak at the point where it touches the metal if not sealed on the out side.
I would pull the window, skin the exterior, and do the foam as you show. Just put a sheet of plastic in front of the OSB.
The expanding two part pour foams do push hard outward, and you do need to support the glass if that's what you chose to do.
I will be using two part pour foam to build window and windshield inserts for their insinuative property's. If I'm in a extremely hot or cold climate, I can use the custom molded inserts to block the heat cold in most my windows.
The inserts will do the same as a insulated curtain, but much much better.
"Don't argue with stupid people. They will just drag you down to their level, and beat you up with experience."
Patently waiting for the apocalypses to level the playing field in this physiological game of life commonly known as Civilization