ProfileService data loss due to server not able to find the player's profile in the Manager module

Every so often a player in my game will report that when they rejoin, their progress from anywhere between the last 5 minutes to the last 2 hours didn’t save.

After doing some testing, I believe this is from the server not finding their profile when using profile = Manager.Profiles[player]. I’m still not certain that that’s the issue because no related errors are occurring on either the client or the server, but I recently found that in my shop code on the server, Manager.Profiles[player] was returning nil.

I just now thought of kicking the player if their profile isn’t found when saving their data, which if I’m right about that being the issue then I think this will fix it, but I’m making a post here to see if there’s a better way to go about solving this data loss issue or if something else could be the cause.

function DataManagerServer.SaveData(player: Player, dataType, Value)
	local profile = Manager.Profiles[player]
    if not profile then player:Kick(KICK_MESSAGE) return end -- I just added this
	if profile == nil then return end
	if dataType == nil then return end
	if Value == nil then return end
		
	profile.Data = Value
	
end

Here’s what the client-side part of this saving looks like if you need to see:

function DataManagerClient.SendToServer()
	while true do
		task.wait(1)
		if next(DataManagerClient.playerData) ~= nil and DataManagerClient.playerData ~= nil then
			packets.dataPacket.send({ -- This is basically just a RemoteFunction, I'm using a community module called ByteNet in place of them
				dataType = "SaveData",
				value = DataManagerClient.playerData,
			})
		end
	end
end

And finally, here are the only places where the player’s profile gets released:

Players.PlayerRemoving:Connect(function(player)
	local profile = Manager.Profiles[player]
	if not profile then return end
	profile:Release()
end)

game:BindToClose(function()
	for _, profile in Manager.Profiles do
		profile:Release()
	end
end)

I should note that when the data loss happens, it doesn’t happen for everyone in that server, only that specific player.