STM32F401RE, FreeRTOS: osErrorISR returned by osKernelInitialize(), osThreadNew(), osKernelStart()

Description
Each OS function call returns osErrorISR. What is more, IS_IRQ() function returns value: 32 decimal. It should not happen, because none of the IRQ is defined.

osStatus_t osKernelInitialize (void) {
  osStatus_t stat;

  if (IS_IRQ()) {
    stat = osErrorISR;
  }
  else {
    if (KernelState == osKernelInactive) {
      #if defined(USE_FREERTOS_HEAP_5) && (HEAP_5_REGION_SETUP == 1)
        vPortDefineHeapRegions (configHEAP_5_REGIONS);
      #endif
      KernelState = osKernelReady;
      stat = osOK;
    } else {
      stat = osError;
    }
  }

  return (stat);
}

/**
  \brief   Get IPSR Register
  \details Returns the content of the IPSR Register.
  \return               IPSR Register value
 */
__STATIC_FORCEINLINE uint32_t __get_IPSR(void)
{
  uint32_t result;

  __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
  return(result);
}

The most interesting fact is that, such problem occurs only if functions responsible of reading GPIO pin are used, such as:

LL_GPIO_IsInputPinSet(GPIOA, LL_GPIO_PIN_3) 
LL_GPIO_IsOutputPinSet(GPIOA, LL_GPIO_PIN_2) 

There is a link to repository with my project: https://github.com/BusKetZz/STM32
I would appreciate any help.
Best regards