I would inform the buyer of whatever info is necessary.If you sell it with outstanding monthly payments still due to the carrier, will you tell the potential buyer so that they can make an informed decision? That is the question in my mind.
I bought a used iPhone X way back on eBay - it worked fine for almost a year on T-Mobile, then I finally reinstalled iOS on it. I could no longer activate it after that. It turns out the phone had outstanding payments due on Sprint, which the seller did not disclose. I traded it in to Apple for an 11 Pro; lost about $300 on it.
The biggest question is if this is still an issue, or if things have changed recently. It seems like being locked into 2-year contracts has gone away, in favor of these new device payment plans, which I suspect don’t work the same way (regarding locking phones, etc.). Still need clarification on that but all I’m seeing is people guessing.