35mm – The film in my film camera won’t rewind. 31 frame flashes intermittently

I’m new to film photography. I recently tried to use the old film camera I had lying around the house, a Kodak S1100 Xl. I shot 31 pictures but couldn’t proceed to shoot more as the LCD display showed the 31 frame flashing intermittently and it wouldn’t let me shoot more. I bought a new battery and tried to shoot more pictures/rewind the film but it won’t work. I read the manual and found out that there’s a manual way to rewind the film, a small “R” button, but that that didn’t work either. I figured the film wasn’t loaded correctly in the first place and that’s why I lost those 5 pictures. Now my problem is that I can’t rewind the film that is supposed to rewind itself automatically after the last shot. I have to add that the number 31 stops flashing when I press the manual rewind button but won’t count down from it to release the film.
Any help?
Should I take the film out in a dark room at night and rewind it myself?