C++ plugin sometimes fails to load

I’ve got a very simple C++ plugin that works 9/10 but that other 1/10 it seems to fail to load/compile properly. If i restart the editor it works again.

any idea what this is and how to fix it?