Oh I'm so sorry to read your post Judy.
Please don't beat yourself up over it you did nothing wrong and I'm sure the dog is also regretting it too.
You have Cody a great chance in life that he may not have had without you and I have no doubt he is watching over you now and enjoying his wings.
I know there are few words that can be said to ease your sorrow but please don't feel guilty or regret anything. Cody would have been happy exploring and enjoying his out of cage time and I'm sure it was quick and painless for him.