There is no automatic cleanup service in OH. You’ll have to “manually” remove the erroneous links. Given the REST API that would be scriptable. Or you can open the JSONDB file and manually remove them.
There are times where one may have temporarily removed the Item or temporarily removed the Thing but you do not want to remove the Link. If the Link were removed automatically, for example, you’d have to recreate all of your Links every time you reload a .items file if the links are defined through the UI. So OH takes a bit of a hands off when it comes to cleaning up the links because ultimately, it doesn’t have enough information to tell the difference between a temporarily invalid Link and one that needs to be removed.