A reference like INV-10452 or a label like Crate 140 kg has a number inside it. You want the number on its own, as a real number you can add up.
The key is that text functions return text, even when the text looks like a number. =TEXTAFTER(A2,"-") returns "10452" as text, which will not sum or sort as a number. Wrap the result in VALUE, or put -- in front of it, to convert it.
When the number sits next to a predictable separator, cut it out with TEXTAFTER and TEXTBEFORE. For Crate 140 kg, take the text after the first space, then the text before the next space: =VALUE(TEXTBEFORE(TEXTAFTER(D2," ")," ")).
When the digits could be anywhere, test each character. MID(D2, SEQUENCE(LEN(D2)), 1) splits the text into single characters, multiplying each by 1 turns digits into numbers and leaves errors for everything else, IFERROR blanks those, and TEXTJOIN glues the digits back together. This keeps every digit in the string, so it suits text that holds one number. If a string holds two numbers they run together.
The ribbon alternative for a fixed pattern is Flash Fill: type the number you expect beside the first row, then choose Data > Flash Fill or press Ctrl+E. It writes fixed values, so it will not update if the text changes.
Convert the results with VALUE even if they look right. A number stored as text is the most common reason a total comes out too low. The Logic and text track practises these conversions.