Currently, armature 'Join' operator empties its source Armature IDs, while not deleting them. This is both fairly useless, and inconsistent with other 'Join' operations on e.g. Meshes, which do leave source obdata untouched.
It should instead probably operate on temporary out-of-main copies of the source armatures data, and also leave the original data unchanged.
Alternative option would be to effectively delete the emptied source armature IDs, together with all the objects using them, but this is probably not the desired behavior either.
Issue revealed while investigating T96452: Armature corrupted after undo, see also
for a reproducible case.