In fiscal 2023 Micron, a maker of memory chips, lost $5.8B. In fiscal 2026 it earned $85.0B. Same company, same kind of product.
Micron didn't "go bad" and then "get good". Its industry went round a cycle. Judge a company like this on one year's numbers and you'll be wrong at the worst moment.