People seem to assume they are inexpensive items.
If you were buying 10 laptops valued at $1,000 each and the cashier only charged you for 9 due to the value of the laptop you would be committing a felony in many states if you walked out of the store with a $1,000 item of merchandise knowing you did not pay for it.
You would be knowingly removing property from the store without compensating the store for the item. A deliberate act. Theft. You would be committing a crime. Whether the clerk made a mistake or not you know you didn't pay for the item and you knowingly chose to walk out with merchandise you had not paid for.
A clerks error doesn't make it legal for a person to take merchandise without paying for it.
Whether it could be proved in court is another story. You could commit perjury and lie about knowing you were taking the item without paying for it. Or take the 5th amendment. Or not testify at all. No matter what you would still be a criminal though.