I need advice about my dog

So I have a beagle/foxhound mix and we’ve had him for 7 years now. He always been sort of an asshole, but ever since my baby was born he’s become worse. He nips at her and growls and it’s just not ideal. And on top of that he barks all of the time, escapes over the gate I use to keep the baby and dog separate. I can’t even have guests over without him going crazy. The other day I had an electric guy come in and he nipped him in the butt and growled at him. Thankfully the guy was okay with it and just laughed it off...anyways I’ve been trying for a year to get him adopted and see if family or friends can take him, but no one wants him. So yesterday I made an appointment to take him back to the shelter we got him from and I don’t know if I can do it. After everything he’s put me through, like the mental anguish, I don’t know if I would feel comfortable with him sitting in a gate waiting to be adopted. I did tell the shelter that if there is any chance of him being euthanized that I would take him back. In addition, I am able to sponsor him as well to be sure he has everything he needs. Still in my heart I feel like it’s wrong, but he literally drives me crazy and I just feel like eventually my lo will get actually hurt by him one day.