But that doesn't help you if the erase command was not implemented correctly.
And I am sure that you cannot implement an erase command from within the operating system. It has to be implemented in the flash memory controller. So if your hardware manufacturer got it wrong, you can't fix it.
We tested ATA commands for sanitizing an entire SSD, [...]. We find that while most implementations of the ATA commands are correct, others contain serious bugs that can, in some cases, result in all the data remaining intact on the drive."
M. Wei, L.M. Grupp, F.E. Spada, S. Swanson: "Reliably Erasing Data From Flash-Based Solid State Drives." <https://www.usenix.org/legacy/events/fast11/tech/full_papers...>
Is that wrong? Does the OS on smartphones generally have direct access to the flash memory proper?
Edit: I remembered another protocol that I would guess is used in smartphones for communication with the flash memory, namely UFS (which is also utilized with SD cards).
Edit 2: Note that it is irrelevant whether the protocol used is ATA, UFS, or something different.
No matter what protocol they are using to communicate, it is quite conceivable that the erase commands are not properly implemented. In fact, as the comment you're replying to pointed out, there have been many devices found historically which do not properly implement erase commands. Since you can't(*) bypass the flash controller and see what's actually in the flash, there is no way to verify whether or not the data has in fact been deleted.
Just encrypt your device. It's so damn simple.
(* Yes of course you can desolder the memory or hook up to it directly and bypass the flash controller that way, like the authors of the paper in GP, but that's far beyond the capabilities of even the average HNian)