2017 Corolla, battery disconnect cause lost duplicate key programming

Purchased replacement key from Ace a few months ago. This weekend, I disconnected the car battery for about half an hour. After reconnecting the car battery, the car would not start with the duplicate key. It did start with the original master key. Ace reprogrammed the duplicate key again and it appears to be working fine. The duplicate did lock /unlock doors as well as open the trunk even though it would not start the vehicle. Is there something special that I should be done when disconnecting the battery, or is this likely a key programming likely issue. Thank you for your opinions!
Disconnecting a battery should have no impact on a programmed key. I just replaced my battery last week in my 2015 for the second time. No issues. Personally, I would never use an aftermarket key to begin with.
It's unlikely that the programmed key has anything to do with the operation of the battery. Any locksmith will tell you that. Although I once had a similar problem, and my dealer swore that I needed to replace the keys from him and buy new ones. Of course, I didn't do such a thing. I found a Cheap 24 Hour Locksmith, called him at 1 am, and fixed my key. The problem was exactly what the duplicate was plugged into, not my battery. The battery doesn't turn on or open the doors if that's what you wanted to know.