I wouldn't unless you got some really thick glass. Coral growth will add a lot of weight to that over time and it seems like a tank stress point to me. I did get some decent looking fake shelves that are significantly lighter that I use.
Your gonna need a LOT of magnets. I have some small ledges for both of my hawkfishes but they are way smaller! I use magnets from K&J magnetics. Use the plastic coated ONLY on the tank side, as anything else is guaranteed to leach into the tank. I just use gel super glue to glue the magnet to the rock. Dry side of the glass I just use the cheap epoxy coated magnets bought on amazon.
I personally wouldn't go as large, but it can work.