This has something to do with character not being fully loaded. This should not be happening and is most likely a engine bug. My current workaround for this is to add a slight delay and constant pcall check until the error is gone and then resume all actions
Just want to say so much for saying this, it delayed my whole game for 2 weeks and by using this I can fix a long term bug. Thank you for existing, thank you for getting a pc and having all the events in the timeline lead up to you posting this. I am giving your name out to 100 people in my Discord server just to show how amazing thing you have said.
When I had this exact same problem. I had statements like
local character = player.Character or player.CharacterAdded:Wait()
to wait for character to load.
But this was not enough the problem.
So I added a
repeat task.wait()
until game:IsLoaded()
to wait till the game is loaded on client side. And it worked!