Filter Script not Working

As filtering is a big part of Roblox, I had to create a script to filter stuff for display on a sign.
The text will pass through the script with no errors but it won’t filter (putting in really obvious things that would be filtered aren’t filtered).

Here is the script, maybe I am missing something?

local rs = game:GetService("ReplicatedStorage")
function rs.DisplayStuff.AskForFilter.OnServerInvoke(plr, msg)
	local textObject
	local TextService = game:GetService("TextService")
	local success, errorMessage = pcall(function()
		textObject = TextService:FilterStringAsync(msg, plr.UserId)
	if success then
		local filteredMessage
		local success2, errorMessage2 = pcall(function()
			filteredMessage = textObject:GetNonChatStringForBroadcastAsync()
		if success2 then
			return filteredMessage
			return "Error: Failed to filter: "..errorMessage2
		return "Error: Failed to filter: "..errorMessage

Looks fine, which of the return statements is typically returning?

return filteredMessage returned on all the tests.
Placing a print(filteredmessage) after the pcall() resulted in showing no filter, the same way it showed up when returned.

Okay, actually, apparently the filter doesn’t work in studio, that’s strange…
The script works just fine. Thanks for trying anyway.

That’s completely normal, because Roblox Studio doesn’t filter out any swears, so you could basically make everything whatever you want in it.