"Unable To Cast Value To Objects" Error When Teleporting

I have a problem with teleporting into a private server The problem is in the server script
Any help you be appreciated :pray:

Server Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CreateServerEvent = ReplicatedStorage:WaitForChild("ServerCreation")

local Players = {}

local TPmodule = require(script:WaitForChild("TPModule"))
local teleportService = game:GetService("TeleportService")

CreateServerEvent.OnServerEvent:Connect(function(plr, list, frame)
	
	local frameClone = frame:Clone()
	frameClone.Parent = frame.Parent
	frameClone.RoomName.Text = plr.Name.."'s Room"
	frameClone.Map.Text = list[3]
	
	local Code = teleportService:ReserveServer(11237644512)
	
	local tpData = {1}
	
	local teleportOptions = Instance.new("TeleportOptions")
	teleportOptions.ReservedServerAccessCode = Code
	teleportOptions:SetTeleportData(tpData)
	
	frameClone.JoinBtn.MouseButton1Click:Connect(function()
		
		if list[2] == "Public" then
			TPmodule(11237644512, game.Players:FindFirstChild(plr.Name), teleportOptions)
		else
			
		end
		
	end)
	
end)

Teleport Module

local TeleportService = game:GetService("TeleportService")

local ATTEMPT_LIMIT = 5
local RETRY_DELAY = 1
local FLOOD_DELAY = 15

local function SafeTeleport(placeId, players, options)
	local attemptIndex = 0
	local success, result -- define pcall results outside of loop so results can be reported later on

	repeat
		success, result = pcall(function()
			return TeleportService:TeleportAsync(placeId, players, options) -- teleport the player in a protected call to prevent erroring
		end)
		attemptIndex += 1
		if not success then
			task.wait(RETRY_DELAY)
		end
	until success or attemptIndex == ATTEMPT_LIMIT -- stop trying to teleport if call was successful, or if retry limit has been reached

	if not success then
		warn(result) -- print the failure reason to output
	end

	return success, result
end

local function handleFailedTeleport(player, teleportResult, errorMessage, targetPlaceId, teleportOptions)
	if teleportResult == Enum.TeleportResult.Flooded then
		task.wait(FLOOD_DELAY)
	elseif teleportResult == Enum.TeleportResult.Failure then
		task.wait(RETRY_DELAY)
	else
		-- if the teleport is invalid, don't retry, just report the error
		error(("Invalid teleport [%s]: %s"):format(teleportResult.Name, errorMessage))
	end

	SafeTeleport(targetPlaceId, {player}, teleportOptions)
end

TeleportService.TeleportInitFailed:Connect(handleFailedTeleport)

return SafeTeleport

Can you please specify the exact line this ocurre?
If you know.

No it just says this error message

Do it throws an error?

Note that you can’t teleport in studio.

The error is in normal roblox in the console in the server section