If the target creature or planeswalker is an illegal target by the time Swift End tries to resolve, the spell won't resolve. You won't lose 2 life or exile Swift End. If the target is legal but not destroyed (most likely because it has indestructible), you do lose 2 life and exile Swift End.