The Nano Gauntlet worked because both it, and the Infinity Stones that were placed in it, were from the same timeline: the Sacred Timeline.
Despite all the time travelling the Avengers did in Avengers: Endgame, they never actually left, or violated, the Sacred Timeline. This was confirmed by Judge Renslayer in the first episode of Loki.
JUDGE RENSLAYER: Are you guilty or not guilty, sir?
LOKI: Guilty of being the God of Mischief? Yes. Guilty of finding all this incredibly tedious? Yes. Guilty of a crime against the Sacred Timeline? Absolutely not, you have the wrong person.
JUDGE RENSLAYER: Oh, really? And who should we have?
LOKI: I suspect, the Avengers. I came into possession of the Tesseract because they traveled through time, no doubt in a last-ditch effort to stave off my ascent to God King.
JUDGE RENSLAYER: That's quite an accusation.
LOKI: Oh, believe me, you can smell the cologne of two Tony Starks. You speak of Time Criminals? It's they you should be after. Perhaps you could provide me with a taskforce and resources, and I could return and eliminate them for you.
JUDGE RENSLAYER: We're not here to talk about the Avengers.
LOKI: Oh, no?
JUDGE RENSLAYER: No. What they did was supposed to happen. You escaping was not.
Loki - S01E01 - "Glorious Purpose"
The only person who violated the Sacred Timeline was Loki, when he took the Tesseract in the year 2012, and used it to teleport to the Gobi Desert. He was supposed to be taken to Asgard and placed in a prison cell there -- as shown in Avengers (2012) and Thor: The Dark World -- but he didn't do that, contradicting those movies, and therefore violating the Sacred Timeline.
The Avengers managed to do everything they did without violating the Sacred Timeline though, for two main reasons.
The first reason is that they didn't try to use any of Infinity Stones in a way that contradicted the events of any of the MCU movies. For example, they didn't try to prevent Thanos from performing the Snap in 2018. Had they done so, that would've contradicted the events of Avengers: Infinity War, thus violating the Sacred Timeline. However, the Avengers wisely chose not to use any of the Stones until they were back in their own present in 2023. By using the Stones to resurrect everyone killed by the Snap there, they didn't contradict anything that happened in the previous movies.
The second reason is that they ultimately returned all the Stones to the exact points in space and time they were taken from. This was explained in the discussion between the Ancient One and Bruce Banner in Avengers: Endgame.
THE ANCIENT ONE: I'm sorry, I can't help you, Bruce. If I give up the Time Stone to help your reality, I'm dooming my own.
BRUCE BANNER: With all due respect, I'm not sure the science really supports that.
THE ANCIENT ONE: The Infinity Stones create what you experience as the flow of time. Remove one stone and that flow splits. Now, this may benefit your reality, but my new one... not so much. In this new branched Reality, without our chief weapon against the forces of darkness, our world will be overrun. Millions will suffer. So, tell me, Doctor, can your science prevent all that?
BRUCE BANNER: No, but we can erase it. Because once we are done with the stones, we can return each one to its own timeline at the moment it was taken. So, chronologically, in that reality, it never left.
Avengers: Endgame
As the Ancient One pointed out, permanently removing the Time Stone from its native time period would indeed have caused a new alternate timeline to branch off from the previous one.
However, as Bruce pointed out, by returning the Time Stone to the exact moment it was taken from, it effectively never left as far as the timeline was concerned. This maintained the established history of the Sacred Timeline, and erased the new branching timeline that otherwise would've been created. The same thing applies with all the other Stones.
(As was alluded to above, the Avengers slipped up once with Loki and the Tesseract in 2012, but they subsequently managed to obtain the Tesseract from the year 1970, and the TVA dealt with Loki and the new timeline he created.)
So the bottom line is that both the Nano Gauntlet, and the Infinity Stones placed in it, were from the same timeline -- the Sacred Timeline -- and as such, they were wholly compatible.