Film Rewinded at 26 exposures, but film is 36 exposure

I’m new to film, and I am using a Pentax ZX-M. I was shooting some portraits on Kodak UltraMax 36 Exposure film and the film rewinded at 26 instead of 36. Anyone have an idea why my camera did this?