All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
We have already mentioned in Fataawa 115711, 112784 and 87944 that it is permissible to kill harmful insects, so please refer to them. We also clarified in them the guidance of the Prophet as to the method of killing them.
As regards the story of the beetle which you mentioned in the question, we have not come across it in the books that we have at hand, and it appears that it is fabricated.
Allaah Knows best.