Heisenbugs
Bugs that change or disappear when you inspect them are called Heisenbugs.
It’s a pun from quantum physics where observing a state alters the state.
These kinds of bugs can be confusing and disorienting at first. A bug is reported, and you can repro it locally. You go to investigate in a development or debug build, and now you can’t reproduce it. What gives?
Common reasons for this include debug vs. release memory allocator behaviour, compiler optimizations, timing issues (especially if you pause and then resume with a debugger attached), or even architecture differences (if you are debugging a local build vs. the arch of target hardware).
Often the biggest hurdle is identifying that you are dealing with this class of bug. Once you know, that insight will help guide the next steps: simplifying further to isolate the bug or recreating the conditions that are required for it to occur.
They also make for good bug solving stories!