What’s happening is that you are attempting to write some data value that you think you have, but actually do not. The issue is not with the writing. It’s that the value you think you are writing is not populated when the write is being performed.
I talk about this stuff (coincidentally in the context of writing to browser storage with my Floppy plugin) in this video: