For the joint pain the first thing I would suggest is getting a vitamin D test done. You can ask your doctor to do one. They might or might not agree - they are considered to be expensive tests. But practically everyone in the UK is low in vitamin D, and if you are hypothyroid your risk must be many times higher. If your doctor agrees to do the test then make sure you get copies of the result afterwords, including the reference ranges. You are legally entitled to them.
But you can get a vitamin D test done privately and all that is required is for you to order a kit, and then prick your fingers. They send vials and lancets as part of the kit.
Low vitamin D is notorious for giving people muscle and joint pain. Actually fixing the cause of your pain is much more sensible than trying to mask it or zonk yourself out just to get some sleep. Vitamin D supplements are easy to buy - they aren't prescription only.
Zopiclone and amitriptyline are both addictive and difficult to get off, and also have side effect lists as long as your arm.
When you speak to your doctor about vitamin D testing, also ask for ferritin, vitamin B12, and folate testing as well. There are lots of nutrients which are often low in people with thyroid problems, but the ones I've given are particularly important.
Also ask for copies of any results, and also ask for results of any thyroid tests (including reference ranges) you've had in the last couple of years or so. Then post them all on a new question and ask for feedback.
Poor thyroid treatment and low nutrients can cause immense numbers of problems, including depression and other mental health problems, and lots of physical problems too.