as Stated already, DietPi is a Raspberry OS. And systemd-analyze is working same way
root@DietPi3:~# systemd-analyze | mawk '{print $(NF-1)" "$NF;exit}'
= 11.276s
root@DietPi3:~#
I did not had time to look into your scripts. Need to say, I’m not a bash coding expect. This is more the domain of or (single) developer MichaIng.