Had to put dog down on Tuesday

I feel really bad right away. I’ve never had to do this before, so I didn’t know what to expect. It cost about $400, but it would’ve been $600 to bring him home after cremation. We went for the $400 because we weren’t prepared for the cost, especially with two kids under three. I thought he would’ve been put to sleep, but he wasn’t. He struggled until the very end and even cried out a couple of times. Is that normal? I’m feeling so guilty and I’ve been a mess throughout this whole thing.