You don't even say that there was a behavior problem with the dog (thus probably not, or you would have stated it) you just made it go away. Wow what a gem!
TRAIN YOUR DOGS
Some dogs are more of a challenge than others but they can/will almost all respond to training. Without training they will revert to natural pack behavior and can easily be unmanageable.
If you are not willing to devote the time to care and train a dog then you should not have a dog. Some people are just not suited for dog ownership.
As to the OP your dog definitely appears to have separation anxiety from your description of behavior. There are some good training techniques that can be used to resolve the behavior. Find a good dog trainer for some techniques. You don't need to medicate the dog like the docs are doing with kids today. May take some work and effort but meds are not the solution to everything out there. Behavior modification works on humans and animals. Meds have their place but they are not the first choice or at least should not be.
Wow what a gem! - SERIOUSLY, you want me to "gamble" with my child's life? SERIOUSLY I'm a gem because I won't keep a designated Most Dangerous Dog listed below. SERIOUSLY I'm a gem because I should have waited till he mauled my daughter THEN and only THEN get rid of him.
Nope, not one problem with the dog - BUT the Rottweiler has been known as a vicious dog to kids because it does not understand the small size of a child compared to an adult. The Rottweiler is listed as a Dangerous Dog Breeds. We had the dog for years before we had a child. We didn't expect to have a child or we would not have purchased the dog.
Bottom line it was a judgement call, and as much as we loved the dog, it's a no brainer when it comes to the safety of your child. Just like I wouldn't leave her near a swimming pool alone, ride in the back of a pick up truck alone etc etc. I just felt it was prudent to eliminate any danger in her life that I could.
An animal is an animal and ALL animals do what they do. Ask Siegfried and Roy how safe their "tamed" Tiger was or all the grizzly bear trainers that were killed by "trained" bears.
It just wasn't worth it TO BE - to others it may be a different story, but FOR ME, keeping the that dog around my child was not a gamble I was willing to make.
As a side not - I trained a police dog for the Tucson Police department. I trailed dogs to walk on their hind legs, only eat on my command, crawl towards me on all fours, only react to hand commands, no voice commands, etc.etc. So training was not an issue for me.
I've been around dogs and training them for decades, and no one can stop a dog from doing whatever he wants to do when he wants to. My brother proved that by "teasing" a highly trained dog to push it's limits. He found those limits when the dog went for his throat. No amount of yelling commands would stop the attack, until I was forced to choke the dog out.
Most Dangerous Dogs - Pit bulls, Rottweilers and Fighting Breeds - DogsBite.org