When issues arise like this, and it's not clear what the problem is or where time is being spent, the best way to understand the root cause is profiling. Profiling is the process of analyzing your application's performance to identify bottlenecks and optimize its behavior. For PHP, there are several profiling tools available. I recommend using one of these: Xdebug (https://xdebug.org/) , Blackfire (https://www.blackfire.io/), or Tideways (https://tideways.com/). These tools can help you get a clear picture of what's happening in your application.
I suggest you to install xdebug, make profile and look at this.
How to install xdebug, documentation is here: https://xdebug.org/docs/install
Docs about profiling: https://xdebug.org/docs/profiler
Hope it helps. Cheers!