>>44539339GF have used the exact same engine but updated from DPPt onward so much so, that for absolutely no reason (read as: has not usage) the Azure Flute has been included in EVERY game since. Because the engine is spaghetti coded, to remove the Azure Flute now would probably cause Pikachu to turn green.
Pokémon from Gen I to II was built that way too, which is why Missingno exists, it's just code you're creating in that moment. Missingno doesn't exist as data until you make it.
Gen III games use a new engine and Gen IV for onward use Gen IV's 3D engine but updated every time. DPPt has 3D objects in it.
Everything I said is backed up by Gamefreak and the Cutting Room Floor. Everyone and their mother knows Pokémon uses a Spaghetti engine made out of math in Gen I, but the thing is... for whatever reason; Gamefreak still code like that.
Math engines (where removing X might cause Y to act out) are so fucking impractical that the only other mainstream company using it is Blizzard.
Overwatch uses a Spaghetti coded engine. They can't patch in Christmas mode w/o giving Roadhog all of his bugs back. Every Christmas they have to patch the game twice because of his Infinity Hook bug. So yeah; GF uses a spaghetti coded engine to this day and the Azure Flute is built into LGPE and SwSh but you just can't use it.