Template sensor: Filling state attributes via loop

Probably because of a wrong code, that is why suggested to try & consult in the main flex-table-card thread (you will have to prepare a short MWE to allow other people to reproduce your case).