Crash at FlushQueuedReferences when using Timer

Hello,
I am currently trying to figure out where the following crash comes from.

LogThreadingWindows: Error: Runnable thread Background Worker #26 crashed.
LogWindows: Error: === Critical error: ===
LogWindows: Error:
LogWindows: Error: Fatal error!
LogWindows: Error:
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
LogWindows: Error:
LogWindows: Error: [Callstack] 0x00007ff72611904b Project.exe!UE::GC::TBatchDispatcher<UE::GC::TReachabilityProcessor<5> >::FlushQueuedReferences() []

LogWindows: Error: [Callstack] 0x00007ff72613b8bb Project.exe!UE::GC::TFastReferenceCollector<UE::GC::TReachabilityProcessor<5>,UE::GC::TReachabilityCollector<5> >::ProcessObjectArray() []

LogWindows: Error: [Callstack] 0x00007ff7260d3933 Project.exe!FEnumBitfieldTest::`vector deleting destructor'() []

LogWindows: Error: [Callstack] 0x00007ff726110a00 Project.exe!UE::Tasks::Private::TExecutableTaskBase<`UE::GC::FRealtimeGC::BeginInitialReferenceCollection'::`5'::<lambda_1>,void,void>::ExecuteTask() []

LogWindows: Error: [Callstack] 0x00007ff72598b5eb Project.exe!UE::Tasks::Private::FTaskBase::TryExecuteTask() []

LogWindows: Error: [Callstack] 0x00007ff725936a8f Project.exe!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __ptr64 __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`UE::Tasks::Private::FTaskBase::Init'::`2'::<lambda_1> >'::`11'::<lambda_1>,0>::CallAndMove() []

LogWindows: Error: [Callstack] 0x00007ff72571a1ce Project.exe!LowLevelTasks::FTask::ExecuteTask() []

LogWindows: Error: [Callstack] 0x00007ff725719f47 Project.exe!LowLevelTasks::FScheduler::ExecuteTask() []

LogWindows: Error: [Callstack] 0x00007ff7256fd132 Project.exe!LowLevelTasks::FScheduler::TryExecuteTaskFrom<LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue,&LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue::DequeueGlobal,0>() []

LogWindows: Error: [Callstack] 0x00007ff72573f402 Project.exe!LowLevelTasks::FScheduler::WorkerMain() []

LogWindows: Error: [Callstack] 0x00007ff725709ad0 Project.exe!UE::CompressedBuffer::Private::FHeader::CalculateCrc32() []

LogWindows: Error: [Callstack] 0x00007ff7258e2323 Project.exe!FThreadImpl::Run() []

LogWindows: Error: [Callstack] 0x00007ff725ce3de2 Project.exe!FRunnableThreadWin::Run() []

LogWindows: Error: [Callstack] 0x00007ff725cd7837 Project.exe!FRunnableThreadWin::GuardedRun() []

LogWindows: Error: [Callstack] 0x00007ffe5a0d7374 KERNEL32.DLL!UnknownFunction []
LogWindows: Error:
LogWindows: Error: Crash in runnable thread Background Worker #26

From a static UFUNCTION I want to call another static UFUNCTION from a timer. For that I use FTimerDelegate::CreateStatic with a reference to my function and then GetWorld()->GetTimerManager().SetTimer()

I suspect this bug to do something with the garbage collector, why I am using gc.CollectGarbageEveryFrame = 1 to debug it and to reproduce it. Without that option, the crash does not happen regularly, but often enough.

If I directly call the functions instead of using the timer, this crash does not happen.

Any idea on how to debug or solve this? Or might there an alternative for Timers?

In editor, sometimes get

     [Inlineframe] UnrealEditor-CoreUObject.dll!UE::GC::TReferenceBatcher<UE::GC::FMutableReference,UE::GC::FResolvedMutableReference,UE::GC::TReachabilityProcessor<5>>::DrainValidated(const unsigned int Num) Zeile 1560	C++
     >	[Inlineframe] UnrealEditor-CoreUObject.dll!UE::GC::TReferenceBatcher<UE::GC::FMutableReference,UE::GC::FResolvedMutableReference,UE::GC::TReachabilityProcessor<5>>::FlushQueues() Zeile 1424	C++
          UnrealEditor-CoreUObject.dll!UE::GC::TBatchDispatcher<UE::GC::TReachabilityProcessor<5>>::FlushQueuedReferences() Zeile 2942	C++
          UnrealEditor-CoreUObject.dll!UE::GC::TFastReferenceCollector<UE::GC::TReachabilityProcessor<5>,UE::GC::TReachabilityCollector<5>>::ProcessObjectArray(UE::GC::FWorkerContext & Context) Zeile 718	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!CollectReferences::__l3::<lambda_1>::operator()(void *) Zeile 853	C++
          UnrealEditor-CoreUObject.dll!`CollectReferences<UE::GC::TReachabilityCollector<5>,UE::GC::TReachabilityProcessor<5>>'::`3'::<lambda_1>::<lambda_invoker_cdecl>(void * P, UE::GC::FWorkerContext & C) Zeile 853	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!UE::GC::ProcessAsync::__l40::<lambda_1>::operator()() Zeile 5542	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!Invoke(UE::GC::ProcessAsync::__l40::<lambda_1> &) Zeile 47	C++
          UnrealEditor-CoreUObject.dll!UE::Tasks::Private::TExecutableTaskBase<`UE::GC::ProcessAsync'::`40'::<lambda_1>,void,void>::ExecuteTask() Zeile 701	C++
          UnrealEditor-CoreUObject.dll!UE::Tasks::Private::FTaskBase::TryExecuteTask() Zeile 436	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!UE::Tasks::Private::FTaskBase::Init::__l2::<lambda_1>::operator()() Zeile 157	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!LowLevelTasks::FTask::Init::__l11::<lambda_1>::operator()(const bool) Zeile 499	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!Invoke(LowLevelTasks::FTask::Init::__l11::<lambda_1> &) Zeile 47	C++
          [Inlineframe] UnrealEditor-CoreUObject.dll!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`UE::Tasks::Private::FTaskBase::Init'::`2'::<lambda_1>>'::`11'::<lambda_1>,0>::Call(void *) Zeile 162	C++
          UnrealEditor-CoreUObject.dll!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48>::TTaskDelegateImpl<`LowLevelTasks::FTask::Init<`UE::Tasks::Private::FTaskBase::Init'::`2'::<lambda_1>>'::`11'::<lambda_1>,0>::CallAndMove(LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48> & Destination, void * InlineData, unsigned int DestInlineSize, bool <Params_0>) Zeile 171	C++
          [Inlineframe] UnrealEditor-Core.dll!LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48>::CallAndMove(LowLevelTasks::TTaskDelegate<LowLevelTasks::FTask * __cdecl(bool),48> &) Zeile 308	C++
          UnrealEditor-Core.dll!LowLevelTasks::FTask::ExecuteTask() Zeile 627	C++
          UnrealEditor-Core.dll!LowLevelTasks::FScheduler::ExecuteTask(LowLevelTasks::FTask * & InOutTask) Zeile 150	C++
          UnrealEditor-Core.dll!LowLevelTasks::FScheduler::TryExecuteTaskFrom<LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue,&LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue::DequeueGlobal,0>(LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue * Queue, LowLevelTasks::TLocalQueueRegistry<1024>::FOutOfWork & OutOfWork, bool bPermitBackgroundWork, bool bDisableThrottleStealing) Zeile 350	C++
          UnrealEditor-Core.dll!LowLevelTasks::FScheduler::WorkerMain(LowLevelTasks::FSleepEvent * WorkerEvent, LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue * WorkerLocalQueue, unsigned int WaitCycles, bool bPermitBackgroundWork) Zeile 378	C++
          [Inlineframe] UnrealEditor-Core.dll!LowLevelTasks::FScheduler::CreateWorker::__l2::<Lambdafunktion>() Zeile 70	C++
          [Inlineframe] UnrealEditor-Core.dll!Invoke(LowLevelTasks::FScheduler::CreateWorker::__l2::void <Lambdafunktion>(const TArray<FString,TSizedDefaultAllocator<32>> &, UWorld *, FOutputDevice &) &) Zeile 47	C++
          UnrealEditor-Core.dll!UE::Core::Private::Function::TFunctionRefCaller<`LowLevelTasks::FScheduler::CreateWorker'::`2'::void <Lambdafunktion>(const TArray<FString,TSizedDefaultAllocator<32>> &, UWorld *, FOutputDevice &),void __cdecl(void)>::Call(void * Obj) Zeile 480	C++
          [Inlineframe] UnrealEditor-Core.dll!UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<1>,void __cdecl(void)>::operator()() Zeile 629	C++
          UnrealEditor-Core.dll!FThreadImpl::Run() Zeile 69	C++
          UnrealEditor-Core.dll!FRunnableThreadWin::Run() Zeile 149	C++
          UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() Zeile 71	C++
          kernel32.dll!00007ffe5a0d7374()	Unbekannt
          ntdll.dll!00007ffe5a3dcc91()	Unbekannt

Similar to here Editor crashes on startup if uninitialized UPROPERTY object pointer is used in USTRUCT - #11 by anonymous_user_528b643b1 I had uninitialized AActors* in a struct. Initializing them with nullptr now prevents the crash from happening, even when using gc.CollectGarbageEveryFrame = 1