Making your own boxes from sheets of polystyrene is very easy, but it is time consuming. Time is money, so while the materials are cheap, the final product cost (material + labor) is high.
XPS foam is easily glued together with polyurethane glue (like gorilla glue). Easy but very messy and time consuming because you have to clamp the pieces together for a good 20 minutes for the glue to set up before moving to the next step. The gluing and clamping delays are the real time killers in making your own.
The bees will start chewing on exposed XPS foam sooner or later, so it would be very wise to cover or coat the interior surfaces with something. Foil, hardboard, plastic, paint, etc.
Finally it would be very wise to paint the finished XPS hive because it is susceptible to UV from the Sun. It will break down pretty quickly when exposed to the full Sun. Regular latex works fine for painting the hives.
The hives in the photo are constructed of 38mm thick extruded polystyrene (XPS). These happen to use a mid entrance which isn’t the most thermally efficient, but it keeps the skunks at bay. These hives are toasty warm inside all winter as long as your bee population doesn't tank.