Executing this exploit results in a Dusk Mane Necrozma that knows moongeist beam.
1) Have a Dusk Mane Necrozma and a Dawn Wings Necrozma in your party. Both need to be holding ultranecrozium z.
2) Enter a battle.
3) Swap to the Dusk Mane Necrozma. (Starting the battle with it is also ok.)
4) Use ultra burst to turn into Ultra Necrozma.
5) Swap to Dawn Wings Necrozma.
6) Use ultra burst to turn into Ultra Necrozma.
Note: You should now already see that things start to go wrong. The Dawn Wings Necrozma turns into a Dusk mane Necrozma during the animation.
7) End the battle.
8) Your Dawn Wings Necrozma will now have become a Dusk Mane Necrozma with the move it originally had. This allows Dusk Mane Necrozma to learn every move a Dawn Wings Necrozma can learn.
You can turn the bugged Dusk Mane Necrozma back into a Necrozma and a Lunala by using a N-Solarizer.
You can perform these steps to get another result:
1) Have a Dusk Mane Necrozma and a Dawn Wings Necrozma in your party. Both need to be holding ultranecrozium z.
2) Enter a battle.
3) Swap to the Dawn Wings Necrozma. (Starting the battle with it is also ok.)
4) Use ultra burst to turn into Ultra Necrozma.
5) Swap to Dusk Mane Necrozma.
6) Use ultra burst to turn into Ultra Necrozma.
Note: Instead of turning into a Dawn Wings Necrozma (as you would think it would) the animation seems to bug out and your Dusk Mane Necrozma will seem to remain a Dusk Mane Necrozma after the animation. I do not know if the actual stats have changed. You cannot use ultra burst again with this pokemon during this battle. If you end the battle everything seems to return to normal.
I have not tried using more than 2 ultra bursts in a battle.