Yes, I agree with you. The middle section in prison is the only segment playing in reality.
You refer to it as a dream and even to the two segments before and after the prison scenes as the same dream. Here I beg to differ with you.
I don't think the first segment is a dream, but is playing inside Fred's head. He is in prison and is being interrogated for the murder of his wife.
The second segment begins when Fred has asked the doctor some medicine for his headache (caused by his intense concentration on the creation of his fantasy). I don't know if this is sleeping medication or just for relaxing. It could be that this second segment is indeed a dream, where Fred can delve deeper into his fantasy (hence the bodyswap, which only can be done in a much stronger fantasy). So this can be a dream, but I'm not sure.
This indeed is than the reverse structure of MD, where Diane begins with a dream and continues with her fantasy in the second segment.