Custom firmware is needed for this to work
https://3ds.hacks.guide/godmode9-usage#removing-an-nnid-without-formatting-your-device
---------------
Press and hold (Start), and while holding (Start), power on your device. This will launch GodMode9.
Press (Home) to bring up the action menu.
Select Scripts
Select GM9Megascript
Select Scripts from Plailects Guide
Select Remove NNID
Press (A) to continue.
Press (A) to unlock SysNAND (lvl1) writing, then input the key combo given.
Press (A) to continue.
Press (B) to return to the main menu.
Select Exit
Press (A) to relock write permissions if prompted.
Press (Start) to reboot your device.
---------------
You must have CFW on your 3ds!