I'm going to assume you are far enough into the game to receive mystery gifts. That 006-0112 error code is because you've lost your internet connection. First of all, power down your 3DS for 10-15 seconds and turn it back on. Go into the 3DS settings and test your internet connection. If the test is successful, load your game back up and try doing something that requires being online, like doing a wonder trade. If that works, try your code again. If the test was not successful, try powering down your modem/router for 10-15 seconds and booting it/them back up and test again. If still unsuccessful, delete your internet connection and add it back in. If that still doesn't work, you might want to contact Nintendo.
It's 100% a network issue. Everything else works fine, it seems the gamefreak servers work differently, and my network is kicked off or blocking the access to the servers, for some reason. I really don't know where I would begin, and the nintendo help service is ****. I'm thinking of going to mcdonalds or some other public place and trying to redeem the codes there, see if there is any success, but then again, I don't want to be THAT guy