I'd be really curious to know how similar the Switch code is. On the surface, the game seems to have been extended quite a bit, but I feel like a lot of it is just uncovering functionality that already existed in the codebase, e.g. the ability to place arbitrary items on the outside grid, I'm fairly sure the "engine" already supported this, and it was the way outside objects were implemented, there was just no interface for adding/removing them.
https://www.reddit.com/r/gamedev/comments/fnfdic/nintendos_g...
Which is crazy since (having played NL and NH for a combined 1500 hours) even the little, deep details carry on from New Leaf. If I didn't know better I'd say NH was using an evolved NL engine.
My observation was the data structures/file formats were basically slight modifications of the ones used in other first party Nintendo games, primarily Mario Kart and Mario Party. So it seems like it's always drawn heavily from some internal SDK/engine, it's just not clear how much, or how much of that engine is saved between consoles.
Anecdotally, the DS and Wii (and ... maybe the GC? I don't remember now) used the same file format for the dialogue scripts, although the DS version was little-endian, and broke all my (terribly brittle) "tooling". The 3DS was totally different, and I ... Think the Switch was a variant of the 3DS format? It's been a hot minute since I've looked at any of this stuff :-)