I don't know if things have changed because I use a rather old Content Pipeline modified to my needs, but the references are stored in the Content.mgcb file.
This won't fix, but will speed up recovery:
If you edit that (working) .MGCB file with a text editor you will see a line starting with /reference: almost at the start of the file.
What I'd do is, once you have a working MGCB file, copy the /reference line and the contents of the folder containing the DLL into a safe place. Each time it fails again, restore the folder and restore the /reference line.
To find a more permanent solution, I first I'd try to pinpoint the source of the problem, if /reference disappears, or DLL change. To do so, next time it fails, check the MGCB file:
If /reference disappears, it could be a malfunction of the pipeline program, or maybe a you're using an automatic generator to create/modify the MGCB file which is skipping the /reference line.
If DLL changes (use a MD5 on all DLLs when you get back a working environment) or disappear, the culprit may be nuget, or even a virus (or worse, the antivirus XD)