Remote Function not invoking

Hello, everyone. I am doing a little handler script which needs to get some data from the server. The code works until I invoke the event to the server, after that nothing happens. Nothing in output, which is odd and it doesn’t fire the event as the server script does not print anything. I am not sure what the issue can be here.

Part of the LocalScript that handles this:

for _, x in pairs(buttons:GetChildren()) do
	x.MouseButton1Click:Connect(function()
		local punFunction = ReplicatedStorage.AdminConfig.Events:FindFirstChild("PunishmentLogs")
		print(punFunction)
		print("yes")
		print(x.Name)
        --works here
		local puns = punFunction:InvokeServer(x.Name)
        -- but not here
		print("yeha")
		print(puns)
		for _, x in pairs(puns) do
			local clone = openedMenu.Case:Clone()
			local userPic, isReady = Players:GetUserThumbnailAsync(puns["Moderator_Id"], Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
			clone.Id.Text = tostring(puns["Case"])
			clone.Mod.Text = puns["Moderator"]
			clone.Reason.Text = puns["Reason"]
			clone.Modpic.Image = userPic
			clone.Parent = openedMenu.modList
		end
		hider.hide()
	end)
end
Server script, if you need this for some reason.
local punFunction = ReplicatedStorage.AdminConfig.Events:WaitForChild("PunishmentLogs")


local function findData(player, base)
	local correct_bases = {"warns", "sbans", "pbans", "tbans"}
	print("yes")
	print(player.UserId)
	print(base)
	local user_cache
	if table.find(correct_bases, base) then
		local success, err = pcall(function()
			user_cache = PunishmentLogs:GetAsync(player.UserId.."_"..base)
		end)
		if success then
			if user_cache then
				user_cache = HttpService:JSONDecode(tab)
			else
				user_cache = {}
			end
			return user_cache
		else
			return {}
		end
	end
end

punFunction.OnServerInvoke = findData

Any help is appreciated as I’m stuck here.

Nvm, got it working. Thanks to this post.