You are initializing app variable list display
to an empty list on the “All thoughts” screen. But that screen comes after the “Home screen” screen. So on the Home screen where you are trying to get an item from that list, that’s going to fail. Even if it did work, it would be an empty list.
What are you expecting the value of these blocks to be?
Because you’re taking a random item from an empty list…
As an example, please set app variable list display
to an actual value on the home screen. Then test and see if you still get undefined.