Script stops working if there is no print statement

I want to achieve a way that this script part works without the print statement as I do not want to print stuff into the console with useless information. The issue is that without the print statement it’ll stop working. As you can see below in the code snippet, if added a print statement to temporarily solve this issue, but as said before I like to have removed as I do not want to print useless statements.

function module:GetPermissionLevel(Player:Instance)
	local PlayerDataFolder = ServerStorage.ModeratorGui:WaitForChild("PlayerData",10)
	local PlayerEntry = PlayerDataFolder:WaitForChild(Player.Name,10)
	local Role = PlayerEntry:WaitForChild("Role",10).Value
	
	local PermissionsTable = PermissionLevels[string.lower(tostring(Role))]
	if PermissionsTable then
		print("Checkup") -- As soon this is removed, it'll stop working
		return true,PermissionsTable
	elseif not PermissionsTable then
		return false,"The given player has an unofficial role."
	end
end

i cant see why it would do that but i can see your kinda doing elseif for no reason

local playerDataFolder = ServerStorage.ModeratorGui.PlayerData

function module:GetPermissionLevel(player:Instance)
	local playerFolder = playerDataFolder[player.Name]
	local role = playerFolder.Role.Value
	print(role)
	local permissionsTable = permissionLevels[string.lower(tostring(role))]
	if permissionsTable == nil then
		return false, "The given player has an unofficial role."
	else
		return true, permissionsTable
	end
end

do you get any errors in the output