It looks like the killing blow was dealt by your TC, instead of the villagers.
If a town center, or any military unit, deals the killing blow to an animal, it will have no food. A villager must deal the finishing blow in order for it to have food; this is intended – when military units kill animals, they “lame” it and make it impossible to gather food from.
So the TC reacts to it as an enemy and shoots it if a vil is garrisoned? I don’t always garrison when luring, but see others do it so I thought, why not? I guess the vil must be released before it dies.
The TC only shoots the boar if you ever right clicked the boar when you have the TC selected. Otherwise, the TC will not fire; the boar is treated as neutral.
So instead of right clicking, try to click the “Set gather point” button (or hotkey), and left click the boar.