If you ever gain 3 or more doubloons with the Freed Prisoner's night ability in a single night, discard the Freed Prisoner. If the Witch gains 2 doubloons using her ability, that’s the Witch’s doing, not the Freed Prisoner. However, using the Witch to gain 3 doubloons by copying the Freed Prisoner's ability will still cause the Prisoner to be discarded.