Occasionally the test infrastructure is just overloaded. I would suggest making a change somewhere (eg adding a space) and running it again to see if the issue is transient or not.
It’s still happening even after doing many spaces or comments, or using tenaries. Will using StringBuilder or doing this locally might help? Have you solved this problem before?