I could reproduce it with the following simple bash script:

printf '\r\e[K0'
sleep 1
printf '\r\e[K1'
sleep 1
printf '\r\e[K2'
sleep 1
printf '\r\e[K3'
sleep 1
printf '\r\e[K4'

The result is:
./test.sh
^[[K4
Compilation finished at Thu Feb 22 01:10:34

Interesting enough that the issue is not reproduced without sleeps. It seems that the stream must be flushed to reproduce the issue.