Building your own is cheaper, although not by a ton. Valve isn't taking a loss on them.

Yeah, just barely, and only if you don't value warranty or build time. I'm also not super sure you could get something together that is somewhat compact like the steam machine and still be cheaper.

I've built two PCs in the last 5 years and both have had parts that were broken from the factory... There is something to be said about being able to hand off troubleshooting and replacement. I had ASRock pointing fingers at everything else to the point where I had swapped out CPU, PSU, and RAM, until they relented and replaced the motherboard (the replacement which is broken again now 5 years later by the way...)