How to fix this "MemoryStoreService: InternalError: Internal Error. API: SortedMap.Set, Data Structure: UnknownMemoryStoreSortedMap."

Module MemoryHandler.lua

-- MemoryHandler.lua
local MemoryStoreService = game:GetService("MemoryStoreService")

local module = {}
module.__index = module

function module.new(name: string, expiration: number)
	local self = setmetatable({}, module)
	self.expiration = expiration or 3600 -- 1h mặc định
	self.store = MemoryStoreService:GetSortedMap(name)
	return self
end

-- Lưu dữ liệu vào Map
function module:Set(key: string, value, ttl: number)
	local success, err = pcall(function()
		self.store:SetAsync(key, value, ttl or self.expiration)
	end)
	return success
end

-- Lấy dữ liệu từ Map
function module:Get(key: string): Variant
	local success, result = pcall(function()
		return self.store:GetAsync(key)
	end)
	if success then return result end
	return nil
end

-- Cập nhật dữ liệu (giữ giá trị cũ để chỉnh)
function module:Update(key: string, callback: (Variant) -> Variant, ttl: number): Variant
	local success, result = pcall(function()
		return self.store:UpdateAsync(key, function(v: Variant)
			return callback(v)
		end, ttl or self.expiration)
	end)
	if success then return result end
	return nil
end

-- Xoá key trong Map
function module:Remove(key: string): boolean
	local success, _ = pcall(function()
		self.store:RemoveAsync(key)
	end)
	return success
end

return module

When I run the below script on the server, it always throws the error “MemoryStoreService: InternalError: Internal Error. API: SortedMap.Set, Data Structure: UnknownMemoryStoreSortedMap.”
This error only shows when i use roblox studio but i still cant fix it

local MemoryHandler = require(ServerScriptService.Modules.MemoryHandler)
local MemoryStore = MemoryHandler.new("PlayerStages")
Players.PlayerRemoving:Connect(function(player)
	MemoryStore:Set(player.UserId, 1)
end)

By the looks of it, :Set should work. May I suggest testing this without using OOP and see if it works then? Another guess is that player.UserId might be seen as an “Integer”, while key has a string. Though I suspect this isn’t the cause of the issue.

It could also be that self.store is not actually storing the SortedMap properly. I typically follow All about Object Oriented Programming guide, which does not match the way you do OOP. Specifically the line local self = setmetatable({}, module).

The above are just guesses as to what the issue might be. Hopefully, these steps might help narrow down what is causing the issue.

local MemoryStoreService = game:GetService("MemoryStoreService")
local MemoryStore = MemoryStoreService:GetSortedMap("PlayerStages")
Players.PlayerRemoving:Connect(function(player)
	MemoryStore:SetAsync(player.UserId, 32, 3600)
end)

I tried many ways to write it, but it still fails, this is the shortest code to test for this error, on roblox studio it still reports the error “MemoryStoreService: InternalError: Internal Error. API: SortedMap.Set, Data Structure: UnknownMemoryStoreSortedMap. - Studio” when I Stop “Test” experience