There are at least two cases of bugged "friendly" characters in a normal (unretired) fortress:
1. Babies born by visitors.
2. Visiting members of performance troupes not present when a troupe petition was made. In this case I think the issue is that the performance troupe members belong to an entity that supposedly has been fully incorporated into the fortress, which normally (when e.g. criminal groups are fully incorporated into other criminal groups) should result in the dissolution of the group incorporated and the transfer of the membership to the receiving entity. However, a site government is a different class of entity from a performance troupe, although probably an incompatible one (i.e. you can be a member of one, but not both at the same time), which causes issues. On top of that, the whole business of fortress members leaving and returning (as the bugged troupe members claim to do), is rather messy and buggy (citizens leaving lose the ownership of their rooms at least: I don't know if that goes for hoarded clothing and trinkets as well, and we're painfully aware of the equipment corruption bug).
In your example, the civ is an entity, as is the performance troupe. A god isn't an entity, but a religion to a god is, and that is compatible with the two others. However, I'd suspect membership of a site government, performance troupe, merchant company, mercenary company, and criminal gang/refugees are, or should be, mutually exclusive, although there is the weird case of necro site governments founding site governments that are subordinate to them, somehow (site governments can also reclaim sites, but the new site government then answers to the civ, not the founding site government). A master/apprentice relation is a personal relation, with no entity involved.
It can be noted that it's fairly common for performance troupe members to be members of enemy civs, including the gobbo civ your fortress is at war with (without being "real" spies with a false identity, etc.), and while there's no indication in the fortress game of that fact (you'd need Legends Mode info), those buggers still report straight back to their civ to let the civ know where your traps are as soon as they leave the map (killing them while still in the fortress prevents that, but you need third party tools to know they're actually enemies).