I'm the Nutmeg of Consolation by Obrian this is mentioned and it strikes me as strange that such a thing would be purposefully done.
In some conditions ships could be preserved for future use by sinking them in shallow water. For instance, the sail training brig Niagara sailing today out of Erie, PA was rebuilt after being sunk for preservation. (In 1820 in freshwater, after the war.)
But this was not commonly done by European cultures, and I've never come across an account of a European navy doing it.
Warships were mothballed by leaving them 'in ordinary.' Moored at a naval base with all masts, guns, stores and possibly ballast removed. Bear in mind that without large cranes you can't really haul them out of the water effectively, and space in drydock was too valuable for storage. Old warships were often converted into floating barracks or static gun batteries and eventually sold for scrap timber.
Come to think of it, the Nutmeg was sunk in an isolated location where there were few prospects of selling her off, just like old U.S. navy vessels on inland water bodies.