Whether it is right according to the book of IRS, I have also written off as a total loss a number of these dead stocks "off the books" but retain them in the account until the broker erases them due to no record of existence (they notify me of this). Only on one occasion did the stock reemerge as a viable stock.
Then I reinstate it on account and enter $0 purchase cost. Any pps gains upon sale of these shares would then be total capital gain and taxes paid accordingly.
As I mentioned, this has happened only once in my career as an investor. I am an eternal optimist...never know until the fat lady sings. True, she hardly ever sings, but I keep listening!