This is a common bug. As you noted, the project should be fully functional despite the error code, but I agree that it is unwanted and unhelpful. Luckily, the solution for most people(including when I was getting this error) is simple.
First, you note that you removed all references to the file. Make sure also that this is true for commented out sections. Some versions of the godot editor (please correct me if I am incorrect) will error from references to files even if they are commented.
The error is with the editor not "realizing" that files have changed, and so we essentially just need to force the editor to reload the project. Close your project, and open Godot again. Now, open another project. If you don't have another, just make a new one and open that. Then close it and open your main project again. Most of the time, this solves the issue. Repeat once or twice if the error persists.
The other common solution is one that you have already tried. I will include it for thoroughness. If you restore the "missing" files exactly to what they were pre-error, and delete through the editor, it may fix the problem as well. Consider reverting certain folders to previous versions through your version control setup.
If this doesn't help, please see https://github.com/godotengine/godot/issues/81867 for more fixes.