You have to pay the investment banks for underwriting, pay the stock exchange for listing, pay for the "roadshow", probably have some additional labor costs on your side and probably some other costs that I'm not aware of.
Why do you think investment bankers paddle IPOs so much? Like sure, they take underwriting risks, but they also set the IPO price, so they control the demand. In other words, imagine if you have 100 pieces of gold. I come to you and tell you: I guarantee to sell this gold for you. You don't know the price until (a day before) I sell it. You still have to pay for my services.