Chat texts dissapearing - possible bug?

In my app users can chat. All chat texts are linked to a session. The user can select a session and view all chat correspondence from that session (or add new text).

This is done based on custom states. Selecting a session sets the session’s number as custom state and filters the chat texts. This works fine. When deselecting the session, the custom state gets an empty value and the chat window should revert to showing all chats. This works fine THE FIRST TIME I do this. All chat texts are being shown. However, When I then select another session and immediately deselect it, I do see all text balloons (groups), but there’s no text inside most of them . MOST of them , that’s the weird part. Some do show text.
I did a comparison between two chat texts in the database - one that was showing properly and one that didn’t, I cannot see a significant difference.
There are no empty records in the database, so all balloons should display text.
Could this be a bug?

This is the view with a session selected (this is how it should be):
2023-06-19 14_01_59-navigatiepagina en nog 5 andere pagina's - Werk - Microsoft​ Edge

As said before, when I deselct the session, all texts are being shown properly.
But…
This is the result when I select and deselect a session a second time:
2023-06-19 14_03_23-navigatiepagina en nog 5 andere pagina's - Werk - Microsoft​ Edge

I got a suspicion this could be the culprit here: using custom states with no value (empty). This is the repeating group showing the chat texts: