Docker build RUN command output now shown in job console most of the time

CI/CD job console randomly not showing docker build RUN output

Running “docker build” on CI/CD job with Dockerfile that contains RUN commands like

RUN echo "hello"
RUN ls -la

the Gitlab job console most of the time does not show the output of those RUN commands.
Sometimes the output is visible on running the same proejct and same ci file, but rarely

[INFO] Step 19/31 : RUN echo "debug"
[INFO]
[INFO] ---> Using cache
[INFO] ---> f63f7801a0bc
[INFO] Step 20/31 : RUN ls -la
[INFO]
[INFO] ---> Using cache
[INFO] ---> e37c0c8b0cbf

Using self managed server Free version 14.5.2 and same version runner
Using eclipse maven temurin 17 image and running docker build via spotify maven docker plugin.