There's an old philosophical puzzle. Suppose you have a wooden boat. You notice some of the planks are getting rotten, so you replace them. Is it still the same boat? As time goes on, you replace the planks one by one, until every single plank making the boat has been replaced. Is it still the same boat?
Alternatively, your grandfather's axe is a family heirloom. But when your father got it, he replaced the head, and when you got it, you replaced the handle. Is it still the same axe?
I posit that identity cannot be determined by the identities of the constituent parts.
First, I'll assume that identity is something that can be discerned - that is it's something that can be determined by observation. Intuitively, this makes sense. If you see two boats, you can distinguish them by how they look, even if they switch positions, or change by small amounts. Even if you have two boats made the same, there will be minute differences that can distinguish them. And the same with the planks. You can tell two planks apart.
But the fundamental constituents of matter have no such identity. An electron is an electron is an electron. All electrons are indistinguishable, and provably so. If you had an electron, and you put it in a box full of other electrons, it would not be possible to find your initial electron again. In fact, there isn't such a thing. Initially, there was one electron in your hand, and many electrons in your box. Then there were many+1 electrons in your box. The one electron cannot be uniquely tracked. It has no identity.
What this means is that if you have, say, a hydrogen atom, and then instantaneously swap out the electron with a different one... Then nothing has changed. Nothing has been done. If that hydrogen atom had an identity, it could not have changed, even if every single subatomic particle in it had been swapped at the same time.
On the macroscopic scale, things can have identity, because they aren't indistinguishable. They have different particles in different configurations following different patterns.
Identity is one of those things that makes sense in our experience, but which breaks down in extreme thought experiments because it has no fundamental truth to it and our flawed conceptions were only meant to work with what we have experience with.