RTX5 osThreadFlagsWait Issue

Im running Keil RTX5 v5.9.0 on a NXP MCXN947VNLT MCU and several of my threads use osThreadFlagsWait but one thread has issues with it and Im not sure why. The wait delay is 20 ticks and the flag its waiting for gets raised every 8-9 ticks but regardless of when the last flag came in, every 20 ticks I get a osFlagsErrorTimeout. So I will get the flag at ticks 2,10, 18, and 26 for example, and the thread receives them and executes as expected, but at tick 20 I also get the timeout error even though I just received a flag at 18 and went back to osThreadFlagsWait. The thread is executing with priority osPriorityAboveNormal2 which is the highest priority in the project. So why am I getting timeout errors?