I have personally seen a method similar to this used on a 24 Gallon Saltwater Current USA Aquapod.
The overflow wall was coated with a black colored foam and rocks were embedded inside the foam to dry; making sure the foam was not covering the overflow teeth.
Months later the aquarium had beautiful purple coralline algae covering the foam and rocks.
I don't know if there were any problems with the foam leaching toxic chemicals into the water.
I am assuming/thinking maybe they became inert once dried, but again I am not 100%.
However, again I did see the tank and the purple coralline algae covering the foam and rocks, which looked good.
If there were any mishaps with this unit along the way, for example immediately after the foam dried and then it was filled with water, corals and a few fish, it wasn't reported.
Very good question... but with little information on the exact science/details on the exact foam and method used.
I'll find out more and report back...