"I am not a duck, but an owl!"
Translation:Ich bin keine Ente, sondern eine Eule!
Where there's a strong sense of contrast, almost like a correction, you use sondern. When it's less connected, use aber.
Ich bin keine Ente, aber ich kann fliegen = "I'm not a duck, but I can fly". This is a separate fact, not a direct contradiction, so aber is fine**.
Ich bin keine Ente, sondern eine Eule = "I am not a duck, but rather an owl". This is basically a correction of the original fact, so we need sondern.
There will be multiple occasions while you learn German where you will realise that English really reuses the same word in situations that are actually different...