It looks like a fake honestly. I could be wrong, but the shell looks similar to some fake multi pets, and I a recall they would play a song, and also have a function where the character could go for a walk while it played a song? (It wasn't that detailed, it just showed boots walking.)
I may be necroposting a bit, but I found it! It wasn't a fake, and it's called a Mushi Pet. (ムシペット) Not to be confused with the Mushiking virtual pet, which is a entirely different thing made by SEGA, and based on the franchise of the same name. (If you are wondering why the names are so similar, mushi means bug in Japanese, so it's basically named the "Bug Pet.") So reidsy was correct.
They where produced in Japan around 2005-2007, (I've heard people say it's 2007, but I've seen blog posts of them for 2005.) but I've heard they are hard to find now. You probably can find them on Ebay like a lot of other odd pets, or if you have Buyee or a VPN you could possibly get them off a Japanese shopping site like Mecari. Don't take my word for it though, I'm not familiar with Japanese shopping sites.
I tried searching it up in Japanese to see if I could find any results since it is a Japanese vpet, and I found a blog post with this image. This picture is of the zebra stag bettle, which the poster noted is not in the Mushiking. I belive the beetle larvae can grow up into many kinds of beetles. I saw someone on Reddit got a elephant beetle. I also found another post by the same blogger. They bought it from a home center, and its almost the same as the original Tamagotchi programming wise, but with fewer functions. They also noted that the price was one third of the average price of a Tamagotchi in Japan. (This post was made in September 2005 for context, so I assume they are referring to the price of a Entama or Keitai.) They also said that they had a problem with the reset button and it kept resetting (As with the problem with the Bunny ROM, which 4 buttons with one being the reset button hence why I thought this was a fake at first.), so they couldn't get it to work, but they cut off part of the reset button to get it to work as you can see in the image. They also fixed a bad battery contact as well.
(EDIT: Did the math using the price of a Keitai as a example, which would have been 2079 yen. I divided that by 3 and got 603 yen, which would be around 4.57 USD. This obviously isn't fully accurate, so take it with a grain of salt.)
They also mentioned that it doesn't have any communication or matchmaking features (unlike the Mushiking) and that the beetle could live for 99 days. (I'm not sure if they mean that it will live up to 99 days, or that it could like forever if it was well taken care of, but the age counter only goes up to 99 days.)
I also saw a picture of one on Reddit from someone asking about them, which is how I found out what it was. This picture features the death screen, which is the common ghost by a grave.
I hope I was able to be helpful!