What happened to Al and Ed's Leg was the result of the Rebound
Since the alchemical forces being manipulated are not human in origin, but of the world as a whole, the consequences for attempting to bypass the Law of Equivalent Exchange in transmutation are not merely failure and cessation. When too much is attempted out of too little, what occurs is called a Rebound, in which the alchemical forces that are thrown out of balance on either side of the equation fluctuate wildly of their own accord in order to stabilize themselves - taking or giving more than was intended in often unpredictable and catastrophic ways such as accidental mutation, serious injury or death.
Source: Alchemy - Rebound
what happened was that Ed and Al had all the Materials collected for an average adult body, whether or not this matched Trisha's body isn't the problem but what they gave up for the Soul, a couple drops of blood.
This is hinted on when Ed is talking to Rose about what makes a human and how Cornello's "miracle" to bring the dead back to life is no act of god.
Ed:
Water, 35 liters. Carbon, 20 kilograms. Ammonia, 4 liters. Lime, 1.5 kilograms. Phosphorous, 800 grams. Salt, 250 grams. Saltpeter, 100 grams. Sulfur, 80 grams. Fluorine, 7.5. Iron, 5. Silicon, 3 grams. And trace amounts of fifteen other elements.
Rose:
What's that?
Ed:
It's all the ingredients of the average adult human body, down to the last specks of protein in your eyelashes.
And even though science has given us the entire physical breakdown, there has never been a successful attempt at bringing a human to life.
There's still something missing, something scientists haven't been able to find in centuries of research.
So what makes you think that hack-job priest with his parlor tricks is going to be able to?
And in case you're wondering, all those ingredients can be bought on a child's allowance.
Humans can be built on the cheap.
There's no magic to it.
Rose:
Well if there's no magic, then you bring someone back to life!
Ed:
Just a matter of time, Rose.
Science will find a way.
Science is the answer to everything.
If I were you, I'd drop the scriptures and pick up an alchemy book.
We're the closest thing to gods there are.
Source: Fullmetal alchemist >01. Those Who Challenge the Sun
What Ed is referring to is the Soul. while scientists in Fullmetal Alchemist can measure all the stuff needed to make a human body the problem arises that there is no equivalent for a soul. even in real life the existence of the Soul is debated because there is no way to confirm it's existence or even measure it to determine what would be of equal value.
Even Ed wasn't sure when they did it
Ed:
Just hold out your finger, okay?
What's a soul, really?
When you take out the myth, it's just the spark that starts life.
This is our blood.
From her blood.
That's a fair trade.
Source: Fullmetal alchemist >03. Mother...
so anyway, back to the rebound. It wasn't a fair exchange as a couple drops of blood wouldn't equal a soul so Al's entire body, soul included, was taken along with Ed's leg by the wildly fluctuating equation taking more than it should in it's attempt to stabilize.
we can even call the end result to be a cause of the rebound, Trisha was given "life" but her body wasn't properly reformed as her organs outside her body not to mention there is no way to confirm if Trisha's soul has been brought back. in the 2003 Anime we learn that this Trisha did continue to live but as a Homunculus didn't have a soul and was missing parts of her memories while in Brotherhood and the Manga, Ed exhumes Trisha's body which Pinako buried and Ed learns that what it wasn't Trisha as her hair colour and bone structure were different.