PromptGamePassPurchaseFinished Bug

I was making this script, but the third parameter always returns false, even if I buy the gamepass or any developer product. The strangest thing is that when I test it in roblox studios solo it works normally, but in team create or live it doesn’t work.

local GamepassFunctions = {
    [1036779659] = function(Player)
        local StarterGear = Player:WaitForChild("StarterGear")
        Tools.RocketLauncher:Clone().Parent = StarterGear
        Tools.RocketLauncher:Clone().Parent = Player.Backpack
    end,
}

MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, wasPurchased)
    warn(player, gamePassId, wasPurchased)
    if wasPurchased and GamepassFunctions[gamePassId] then
        GamepassFunctions[gamePassId](player)
    end
end)

I used another script for the developer product, but the same problem