Is this how a ContactFilter should work?

I have a game and in this game there is a type of enemy with a gun. Using a Raycast I detect when the gun is pointed at the player and when this happens a bullet is fired. This bullets spawns inside the gun and my plan was to basically use a ContactFilter to not allow a bullet to collide with it's shooter, but it isn't working. For experimentation I've made my ContactFilter return false for any collisions with a bullet, the bullets collide with nothing except for the bodies they spawn in. Then I used my ContactFilter to disable any collisions with the shooters, as a result the shooters, who walk back and forth between walls, walk on the floors they spawn on but pass through all walls and other floors.

So it seems like ContactFilters will not filter contacts between bodies that are created in contact. Is this a bug? And if not, how do I get my shooters to not shoot themselves? The guns are essentially rotating turrets in the center of a body.
I think I found my problem, in my program I essentially connect each Actor to the ContactFilter to filter their own contacts, and I made this connection after creating the bullet body, and after some debugging I it seemed like jbox2d checks for any collisions when a body is created, so I simply connected my actor to the ContactFilter before making the body.

Original thread: https://box2d.org/forum/viewtopic.php?t=4995