if youre just using a home gym as as supplement to a commercial gym then something like a good power bar and the rogue r3 and a flat bench and some plates off craiglist are a good option without buying cheap crap from china and without costing a ton.
if you're looking to replace the commercial with a home gym then it realistically will cost alot. Ive spent upwards of 30k, and I only have a handful of machines, about ten bars and dbs up to 130, power rack, bench press etc. I do think one could have a very good setup for way less, but you're workouts are obviously going to be more limited as far as variety goes, but if one sticks to just the basics one can have a great setup for say 5k. The closer youre training is to powerlifting the less compromise a home gym will be compared to a commercial gym.
I find home gym more motivating but if I had wobbly bench, and a handful of mismatched dbs, an old rusty bar I dont think id bother lifting at home and just drive to the gym. It is nice not having to deal with the crowds around a squat rack (seems like no commercial gym no matter how big has more than 2 or 3 squat racks), and just the dbags etc.