This is actually not a bug! When the purchase prompt gets fired to open the purchase dialogue, it actually binds over ButtonB (and ButtonA!). This fires a cancel signal for your BindAction. You can verify this by printing the state inside your bind.
ContextActionService:BindAction("Test", function(action, state, object)
print('lol')
print(state)
--if back then
-- ClickedBack = true
--end
--menu.Visible = false
end, false, Enum.KeyCode.ButtonB)
local MarketplaceService = game:GetService("MarketplaceService")
script.Parent.Activated:Connect(function()
MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer, 1594203080)
end)