I remember having a similar issue with my HTC One M9. My first one randomly had the camera cover glass crack for seemingly no reason. It had a leather folio case around it at all times, and spent most of its time in my jeans pocket. Lots of other owners reported the same problem.
https://forum.xda-developers.com/t/cracked-glass-camera-cove...