The Zelda II palace theme was remixed from 8-bit to 16-bit with different instruments for the Hyrule Castle theme in A Link to the Past. Similarly, the Zelda II palace theme converted from 8-bit to 16-bit is very similar to the Hyrule Temple theme in Super Smash Bros. Melee.
First of all, the second video you posted (zelda 2 temple theme 16 bit style) is a fan made version. It's on the video description.
Second, the similarity between the hyrule castle theme and the palace theme is very minimal (if not non existent).
And last but not least, the fact that the the theme of the Hyrule temple from Melee is a remix of the Zelda 2 song is not trivia, it's general knowledge. It was never meant to be some sort of secret.