constraint.RemoveAll not working for me


	-- If the entity belongs to a ship
	if shipId then
		-- Check to see if the entity that was hit was a mast.
		-- If it was, break the mast.
		local mast = FindMast(target)

		if mast then
			if (target:Health() - amount) <= 50 then
				local mastEnt = ents.FindByName("ship" .. shipId .. "weldmast" .. mast)[1]
				if mastEnt then

					constraint.RemoveAll( mastEnt )
					Ships[shipId].status.masts = Ships[shipId].status.masts - 1
					CheckIfSinking(shipId)

					Ships[shipId].forward:SetKeyValue("force", SpeedPerMast * Ships[shipId].status.masts)
					Ships[shipId].backward:SetKeyValue("force", SpeedPerMast * Ships[shipId].status.masts)

					if attacker:IsPlayer() then
						attacker:PS_GivePoints(PS.Config.MastBreakGold)
					end
				end
			end
		end

The above code is my attempt at removing constraints when a mast in the gamemode Pirate Ship Wars is shot at instead of simply breaking using Ent:Fire.
However, the mast is still welded together when the entity has less than 50 HP.

So my question is, what am I doing wrong?

It only works on constrains created with constraint library, i.e. through Lua.

What would I use if I want to remove map-created constraints?

You’d have to target the specific entity on the map, using something like http://wiki.garrysmod.com/page/ents/GetMapCreatedEntity