It does cost you in certain areas from what I’ve researched. While getting published is certainly free, some of the marketing, the book cover, peer reviews, and manuscript evaluation do cost money when looking to publishers. This is my understanding when looking at publication sites.
Also at the time — and still do — have a rather limited pool of knowledge around publishing and self-publishing, especially when third parties are involved. Regardless, it’s my understanding that there needs to be money from somewhere at some time that has to be exchanged and from my research, some of it was up front and I couldn’t quite afford even the few hundred dollars to have my book be at least somewhat known.