As others have pointed out, having more than 1 instance of a menu in the editor can make that error appear, but it can also be due to the nature of Unity not being able to update the content of inactive tabs when you open the editor.
Just in case, make sure you switch to all tabs opened once after the error starts appearing. Chances are high that the error appears because one of the hidden tab tries to reach an old reference from a previous access that is now closed. (This is often the case of a 2nd inspector or a locked inspector menu which is why closing the 2nd one often does the trick.)
If you select the tab of an hidden/unfocused menu and the content of that menu is blank, but has the header of a selection, you have found the culprit. (For example, if an inspector has an icon and a name at the top, but display no component at all, that’s an example of when an Inspector UI attempt to reach a NULL reference.)
The solution: Either close any hidden/unfocused menus or select them and make sure their current selection is viable. (So, for example, make sure all Inspector has a proper selection, the Animator has a proper animation selected or none, the Controls (Input Actions) refers to the actual inputs action of the project, the Audio Mixer is properly selected, etc.) This error can also happen if you got a custom menu opened and it attempts to access some missing/unavailable files in a project. (As long as any UI elements in the editor attempt to access a NULL/unavailable reference, it will returns that error when you press Play.)
I closed second inspector window and that error is gone, thank you. (Unity 2021.1.22)
– LongingI closed all duplicate panels ( Project and Inspector ) tabs and it worked.
– WirthThanks! Closing duplicate inspector window makes the error goes away. For me, it seems to happen since I place a CustomEditor script which filename does not match the editor class name into the project. Never had this error in 2019.4 though.
– MalaThis was the cause of my issue too. Thanks!
– LynchYup, thats exactly what solved it for me :D
– Telethon