how bout you delete the game from system settings, remove ticket using tiksweep then reinstall game using freeshop..works fine for me both sun and moon on both O3DS and N3DS..no need to mess with anything else..

If I was the OP I'd use FBI to delete the Leaked Pokemon Sun and Pokemon Moon games +their tickets and just use FreeShop to download the PROPER releases. Unless OP wants to risk getting their 3DS banned.