I run a community PBX for a hobby and to learn more about SIP, Asterisk, and other programming skills. I think it all boils down to getting connectivity to the PBX. If you have it hosted elsewhere or on a colocated server, how do you get the inbound trunks to it?

A PBX can be essentially "free" if you have someone in house that can set it up and develop it. You're still paying for it in the time it takes to setup. Some companies make PBX solutions for others who can't or for those who don't want to spend the time developing one. Each different platform has its own learning curve. For Asterisk, the major commercial product is switchvox. Otherwise, someone could make an asterisk box for "free".

I say "free" because you have to pay for:
Hardware for the PBX to run on
Hosting/Colocation
Connectivity
SIP connectivity/trunking
Phones/softphone software

So, maybe it doesn't just boil down to the connectivity, but also the amount of time that you want to invest in getting a PBX up and running.