You've mentioned after certain time period of execution lapse so it can't be the other HAL_Delay before the main while loop. I assume you're getting your LED's to toggle?
So the "delay" function is the only place that calls HAL_Delay unless there is more somewhere else? You haven't shown all your functions so i don't know.