There are many reasons for patent invalidation, such as: the invention patent was rejected in the examination stage or the applicant voluntarily gave up, the patent was invalid after being granted because of not paying the annual fee, and the patent right was invalid.
The published utility model patents are all granted rights, but quite a few have expired.