I happened to have just solved this issue, this strange error seemed to appear because of one of the sub-extensions of the MPlab extension, the MPlab Clangd extension. I looked up the documentation and it said that this was an optional feature in-case of VScode for language support. So I simply disabled the warnings and the program ran smoothly from there.