The Aura or Equipment you target with Codsworth’s last ability doesn’t have to be attached to a creature you control when you target it. You just have to control the Aura or Equipment you’re targeting as well as the creature you’re targeting.