Duh
Sun and Moon has different hex values. So, it won't work of course.
If you want send your Pokémon, Items, etc. You could use PkHex to send it from Sun to Moon, and edit the event flags.
Edit: Make sure to delete Secure Value after injecting the save to remove the save corrupted message.