Invalid argument #3, even though there's no argument #3

I am scripting a module that converts RetroStudio studio selections to Roblox objects, however, whenever I try to execute testing module code without running the game in studio, this error appears:

Error found! Error: ServerScriptService.MainModule:34: invalid argument #3 (Instance expected, got string)

Despite the fact that none of my functions intake 3 parameters, it still throws this issue anyway. Here’s the module code:

local httpService = game:GetService("HttpService")

local function findInstance(path)
	local split = path:split(".")
	if #split == 0 then return end
	
	local constructed = split[1]:lower() == "workspace" and workspace or game
	
	for i=2, #split do
		constructed = constructed[split[i]]
	end
	
	return constructed
end

assert(httpService.HttpEnabled, "HttpService must be enabled via the code: \"game.HttpService.HttpEnabled = true\" in the command line")

return function(json)
	local startTime = os.clock()
	json = httpService:JSONDecode(json)
	
	local success, fail = pcall(function()
		for cn, props in pairs(json) do
			local obj = Instance.new(cn)

			for n, v in pairs(props) do
				obj[n] = n == "Parent" and findInstance(v) or v
			end
		end
	end)
	
	if not success then warn("Error found! Error:", fail) end
	
	local endTime = os.clock()
	print("Exported in:", endTime - startTime)
end

Here’s my command-line code, for testing:

local tab = {Part = {Name = "Billy", Parent = "Workspace"}} local test=game.HttpService:JSONEncode(tab) require(game.ServerScriptService.MainModule)(test)

TLDR; When I test my module with command line code without pressing F8, it just breaks.
Edit: Literally forgot to restart studio. Can’t they just listen for script source changes in the command line?!

I happened to test this script myself since I didn’t see an apparent error. However, upon testing, I noticed that there were, in fact, no errors? Is this the entire script? Line 34 is an os.clock() call, which obviously isn’t the problem.

uh for the last print try

print("Exported in:" ..  endTime - startTime)

(i do not understand this code it all so this might not be soltuton

A mistake on Roblox Studio’s end; it just so happened to be that the command line didn’t update the module script source during command line execution, and instead used my old module script source.

Just a bug with Roblox Studio and not my script, sorry if I’ve caused confusion.

The last print just calculates how much time the script took to export the JSON into Roblox objects.