I updated the Codesys version from βV3.5 SP20β to βV3.5 SP20 Patch1β and that solved the problem.
I am also suffering from the same problem. The "Clear All" in the build clears the error once, but when I open the project again, the same error occurs again. Can someone please help me?