It's true it's not 100% safe. But for you to be able to retrieve the data I heard you must have tools that the US intelligence would have. Extremely rare and you are likely safe if you are selling it to somone.
slightly off topic..
I used to work with an organization that processed personal effects of wound and deceased military and government personnel. One department search media for classified information and some other things.
It was broken down into two tiers, the higher tier did more complex tasks, I work in the lower tier for a few months.
The higher tier hated dealing with Apple products.
Most of the encrypted digital media was sent out to the FBI, as the higher tier's resources were limited, and most of the internal encryption breaking was down with either brut force or guessing of passwords.
The most infamous encrypted media was Apple devices with FileVault. The FBI was unable to crack it, well, at least according to them.
This was a while ago, so things may have changed, but At the time, Apple's FileVault was a beast.
What ever Apple's method of doing a clean wipe of the iPhone is, it is probably fine for most people.
If it wasn't, then government agencies around the world wouldn't be paying top dollar for passcode unlockers.