The expanding foam is incredibly buoyant, so it takes a lot of force to hold a big chunk underwater. The bigger the piece, the more force needed. Have you ever tried to push a large piece of styrofoam underwater?
Expanding foam does adhere to glass well, but not well enough to keep such a large piece underwater. You might do better, if you ever want to try it again, with smaller pieces sprayed onto a silicone backing.