I am receiving an error intermittent when saving data to firebase [closed]

I am receiving an error when I am updating the data which is passing to a function but works fine first whenever refresh of the page. what do you think I am missing in order to solve this.

I don’t have any control to modify any function implementation other than calling.