So I want to use a floor grate to protect myself from the creatures in the Magma Sea, but the game doesn't let me build stuff over it. I thought grates let you build stuff over it, it's quite logical, so either this is a bug or I'm doing something wrong. So, which is it? And if I'm doing something wrong what exactly is it?
If you just want to seal up a hole in the floor that exposes you to magma, then just construct a floor (b)-(C)-(f).
If you want to put a magma smelter or forge on that hole, then I recommend:
1. Find some rock that's adjacent to the magma that you want to use. That's the dirty magma.
2. Dig out some spaces in that rock, so that when the magma flows into those spaces you'll be able to fit all the smelters and forges that you want. That'll be the clean magma.
3. Identify the breach point where you will eventually channel down to connect the dirty magma to the clean magma.
4. Construct a fortification one square behind your breach point.
5. Build a magma-safe wall grate behind the fortification.
6. Channel down into your breach point. The magma should flow through the fortification, through the wall grate, and into the spaces that you've prepared. It's extremely unlikely that any creature can get through both layers of protection. So you can open holes in the floor and put forges or smelters wherever you want.
7. (Optional) If you aren't in a hurry, then add a magma-safe door between the fortification and the grate, and hook it to a lever with magma-safe mechanisms. That way you have the future option to seal off your clean magma so that you can drain it, pump it, or whatever.
My thinking is that the fortification keeps away the building destroyers, and the grate keeps away anything that might be able to slip through the fortification. It's probably overkill, but it seems to work.
Another approach is to build a water closet just above your breach point. It's just a 1x1 room with a hatch at the bottom, attached to a lever. Open your breach point. While your magma tunnels fill, designate your water closet as a pond and let the dwarves fill it to at least 3, though 2 might work. Then pull the lever on your water closet. When the water hits the breach point, you have a fresh warm obisidian wall sealing your clean magma away from anything nasty swimming in the magma sea.