The costs that can come before closing are ones you choose to spend, not ones you owe anyone: a pre-listing home inspection, typically $400 to $600, professional photography, or minor repairs, all optional and aimed at presenting the home well rather than a requirement to list.
Your lawyer's fee and any mortgage discharge penalty also come out at closing through the statement of adjustments, along with commission, rather than as a bill you pay while the home is still on the market.
Nothing is owed until the sale actually closes. Get your hand-reviewed valuation from Joel Dyck.