J.W.
OMG!!! My younger daughter also had nightmares while awake. Unfortunately, the psychiatrist thought it was part of "mental illness" (see http://www.ItsNotMental.com ).
There are many different things that can cause this that are biomedical - ie physical - not "mental". Seizures are one such thing. Hormonal issues. Nutritional and food-allergy related as well (look up gluten and Celiac). These things can even happen with Guillion-Barre.
A new GP years later looked over her records and was stunned that even though her earliest problems in life were sleep-related, nobody had ever ordered a sleep study to be done. Turned out, for my daughter the "nightmares while awake" really were exactly what they looked like to us - REM - She had a form of narcolepsy. We came to learn narcolepsy is not necessarily anything like it is portrayed in the movies - which is usually cataplexy.
So, YES - it can be imagination.
And YES - it can be a medical problem.