Does this mean that the bug is a heisenbug that won't occur when I use
valgrind, and therefore valgrind isn't any use here?
No, you should still use Valgrind and fix all reported errors. The behavior you described is rather common and it is documented in Valgrind FAQ:
When a program runs under Valgrind, its environment is slightly
different to when it runs natively. For example, the memory layout is
different, and the way that threads are scheduled is different.
Most of the time this doesn't make any difference, but it can,
particularly if your program is buggy. For example, if your program
crashes because it erroneously accesses memory that is unaddressable,
it's possible that this memory will not be unaddressable when run
under Valgrind. Alternatively, if your program has data races, these
may not manifest under Valgrind.