No, that is called penal substitution, and as far as I can tell, it’s not compatible with Catholic teaching. It means that Jesus endured the identical sum total of punishment that was due by adding up all the sins of every human ever.
It fails on a number of levels. One of the more indefensible flaws in the idea is this: Scripture tells us that physical death was a consequence of man’s fall. So, if Jesus took away all consequence for sin, then no one who ends up in heaven would ever physically die.
As well, it also leads to another flaw: why doesn’t everyone go to heaven if Jesus took the punishment for all sins? The way around this is to espouse what is called Limited Atonement—the idea that Christ’s sacrifice only was “enough” to cover the sins of only the people who go to heaven. Of course, there is enough in divine revelation to show that idea is wrong, such as passages saying Jesus died for the whole world, or God desires the salvation of all, etc…
Catholics understand the ransom-nature of Christ’s sacrifice. It is very intricate and someone else might be able to explain it more tidily than I. But to understand it, one should look to the sacrifices of the Old Testament which reveal the truth in the New. Back then, a lamb or pigeon or some animal’s blood was shed. The Passover Lamb was to be without “blemish.” Jesus as the new Lamb of God is without blemish and suffices as “ransom” for the sins of the “whole world.” In a ransom, an identical exchange is not necessary (which the penal substitution I describe above demands). Something else is given in exchange, in this case, the sacrifice of an unblemished divine being Who makes it possible for us to escape the eternal consequences of sin by joining to His Body.