Crowe, we've been dealing with a somewhat similar sleep issue with one of our dogs. I haven't listed her in my signature line yet (need to do that), but she's been with us since late March. We "failed" at fostering her and formally adopted her in May. She's probably a Lhasa Apso or a mix, and is estimated to be 8 years old. She had always been a calm, somewhat independent dog, and an excellent sleeper until the very early morning hours of 9/22. She seemed to wake up from a sound sleep in a full blown panic or pain attack--shaking, panting, pawing at us, wouldn't settle down at all. This went on for hours and hours, well into the next day. She didn't sleep at all for almost 24 hours.
On 9/23 I dropped her off at the vet for a thorough exam and blood work. Everything checked out fine. The vet suggested trying some Gabapentin at night to see if that would help her. It didn't do a thing. We were up with her anywhere from a couple of hours to all night. Every night. We tried melatonin for several nights but that did nothing. We had to strategize every evening about what we would try for her, whose night it was to get up with her (or stay up with her if she wouldn't settle at all), etc. She continued to have the panic/pain attacks, and to have very prolonged periods of not sleeping at all. The longest we timed was 25,5 hours without sleeping.
I took her back to the vet Monday, this time for a urinalysis and xrays to see if there were any masses, spinal or joint issues that might be causing pain, or anything else that jumped out. Her xrays and urinalysis looked fine, but the vet (different one than the first time) diagnosed her with infections in both ears, and one of them was particularly bad.
The vet who saw her the first time noted some wax in her ears, but nothing else remarkable. But her ear pigment is very dark and it's very hard to see in them. Anyway, we don't know if the ear infections were percolating all this time and are the root cause of her sleeping issues or if they're recent/coincidental and unrelated. The vet treated them and gave me some Trazadone to help her (and us!) get some rest. The first night it didn't do anything, but last night she slept through the night for the first time in three weeks. It was glorious!
It's going to take a little while to see if the ear infections were the actual cause of her lack of sleeping or if it's something else. We've got Trazadone for eight more nights, so we're hopeful that all of us can get rested up, and then when that's gone--and by then her ears should be feeling much better--we'll see if she'll go back to her normal good sleeper self. If not then I'm hoping the vet will give us an ongoing script for Trazadone (assuming it continues to help her). Not getting enough sleep was really wearing on all of us after just three weeks.
Anyway, I don't know if there's anything there that's helpful to you. I mainly wanted to let you know you're not alone in dealing with a dog with sleep issues. Good luck!