BackgroundTasks not reentrant?

We just got a crash report:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.xojo.XojoFramework 0x000000010825303e TriggerBackgroundTasks(unsigned char) + 164
1 MBS_SQL_SQL_Plugin_20181.dylib 0x000000010d7b6ba9 RunThreaded(void const*, void ()(void const), void ()(void const)) + 601
2 MBS_SQL_SQL_Plugin_20181.dylib 0x000000010d80c6be RunThreadedCommand(MySACommand*, MySAConnection*, void ()(void const), REALobjectStruct*, SAString const*, eSACommandType, int) + 398
3 MBS_SQL_SQL_Plugin_20181.dylib 0x000000010d7ca113 SQLSelectHelper(REALobjectStruct*, SQLExecuteMode, SQLThreadingMode, SQLExceptionMode) + 1699
4 MBS_SQL_SQL_Plugin_20181.dylib 0x000000010d7ca583 StatementSQLSelectMT(REALobjectStruct*, _REALarrayObject*) + 99
5 customer.app 0x00000001053412d8 SQLPreparedStatementMBS.SQLSelectMT%o%oA1v + 88
6 customer.app 0x0000000105995660 SQLiteIndex.FindStringLocalMBS%A1s%os + 1408
7 customer.app 0x0000000105987225 SQLiteIndex.FindString%A1s%os + 469
8 customer.app 0x00000001068d34cd DBWindow.GetSQLSearch%s%o + 13165
9 customer.app 0x00000001068bdb13 DBWindow.getBaseSQL%s%o + 355
10 customer.app 0x000000010684ff23 MainWindow.MainWindow.ResetMessageListCursor%%o<MainWindow.MainWindow> + 339
11 customer.app 0x000000010685343c MainWindow.MainWindow.SetupValentinaAction%%o<MainWindow.MainWindow> + 2748
12 customer.app 0x00000001054faf9c Delegate.IM_Invoke%% + 44
13 MBS_Util_Calls_Plugin_20159.dylib 0x000000010dc3c629 MyRunOnMainThreadBlock(void
) + 137
14 MBS_Util_Calls_Plugin_20159.dylib 0x000000010dc3bd83 MyBackgroundTaskProc(void*) + 83
15 com.xojo.XojoFramework 0x0000000108252f46 0x1080f4000 + 1437510
16 com.apple.CoreFoundation 0x00007fffaa2dbb74 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
17 com.apple.CoreFoundation 0x00007fffaa2db7ff __CFRunLoopDoTimer + 1071
18 com.apple.CoreFoundation 0x00007fffaa2db35a __CFRunLoopDoTimers + 298

Looks like we use MyBackgroundTaskProc to run some code on main thread, which triggers some SQL, which yields and in REALYieldToRB calls background tasks again.
Anyone seen it?

Reported via Feedback: <https://xojo.com/issue/59997>

@William Yu, can you check if TriggerBackgroundTasks may crash here, because we are in a background task already?

And please change bug to be public visible and not marked as beta bug.