Creating the infrastructure and business to manufacture the thing to sell takes time. If you created a proof of concept but it wasn't ready for sale you should still patent it so someone doesn't swoop in. Waiting for it to be on sale before patenting it is for the birds.
If you build and sell something publicly before you start on your patent your patent will be denied.