It has been a while since I poked around with local storage, but I remember that you have to check to see if locally stored variables exist before you try to read and write those variables.
This tutorial was very helpful:
This event sheet diagram is from that article:
As the author of that tutorial explains:
"The key to understanding this event sheet is that Construct 2 LocalStorage is asynchronous. Every LocalStorage action has a matching event that you can use as a condition. Every request to LocalStorage generates an event rather than giving you an answer right away. Remember LocalStorage always says, “I’ll get back to you.” It never gives you something exactly when you ask for it, though it is typically so fast your users won’t notice the difference."
I struggled with other local storage tutorials but something about this person's explanations made sense to me.
Best of luck. Please let us know if you solve the problem, Matt from Manchester!