My momma barn cat, knows the difference between wild birds, and birds we have for pets... just like the dogs know our chickens are pets and not dinner... and same with the pet rabbit.
A cat may be instinctive in nature to kill a bird - but out of our 7 cats, only 1 is a nasty killer of chick(s) and goes out of his way to try to kill birds that aren't wild, just for the sheer fun of killing.
He's a bad cat. There's good cats, and there's bad cats. Cats who know things are in the house, in a room, watched over by you and still want to do everything in their power to kill it, is a bad cat.
You can make excuses because it's a cat - but I rehomed my pitbull when she ripped apart a chicken, and I'd do the same thing with the cat, had the great pyr not made it clear he'd be dead if he tried again outside to go after my chickens.
My big 26lbs cat, has sat there, and snuggled with the chicks, and watched out for them, because he knew they belonged to "me" - so he knew they weren't food.
A good animal, a sound animal, can tell the difference between wild food, and a pet in your house. To me - you can be as careful as you want, but his nature is just that of a bad cat. *shrugs*
If I wanted to keep my chickens safe, I personally would take steps to prevent having the cat near the birds, and if that wasn't enough, the cat would be gone.
But, I prize my birds more than a barn cat who wants to kill babies for fun.
FWIW - my great pyr kills mice, wild birds, rabbits, and all sorts of other critters... but she has never harmed what she's thought was a family member. including my daughters pet bunny.

Animals ARE smart enough to learn that.... but some don't care... and the ones who don't care are not good animals in my opinion.