I'm afraid your assumption is incorrect.
That would require an event handler which would check all the references and change other items in web database directly. And direct changes in web database are not recommended.
Otherwise, if the change (datasource removal) would happen in master database, all linking items would have to be published. And you don't ...
If it happens only when you select the "Publish related items" option in the "Publish Item" dialogue, then it must be related to the deep scan feature. Starting from version 9 the deep scan setting is enabled by default.
When the deep scan feature is used, it affects publishing speed of related items. Sitecore documentation says:
First try to run page in preview mode or experience editor mode. If you are able
to see component there it means rendering is not published. Then go to Web Db and Check datasource and component showing in item's presentation details or not.
You can select Web database by bottom right button as shown in below screenshot