Hi Austin,
it is not permissable for a task to call a function that may suspend the task with the critical section claimed. That is necessarily a deadlock. Claiming the critical section basically means stalling all OS activity, including the scheduler.
You may fall into the fallacy here that with the critical section in effect, portYIELD_WITHIN_API() will NOT invoke the scheduler immediately because the service interrupt will not execute with interrupts disabled but will be deferred until interrupts are re-enabled (critical section left) AND no higher level priority interrupts are pending. That’s the very architecture of the scheduler.