vTaksDelay stops scheduler without resuming it after a few calls

First thing to check would be the ‘usual suspects’ - things like the interrupt priorities and stack overflows. This page provides pointers to the relevant information on things like configASSERT() and configCHECK_FOR_STACK_OVERFLOW https://freertos.org/FAQHelp.html

Which version of FreeRTOS are you using? The newer the more configASSERTS() there are to catch these things.