Extensive studies have been done.
Clearly a perception within the brain relative to input from nerves that no longer exist. It may be expected input that is altered or absent and the brain perceives as abnormal and therefore "painful". The brain is set to receive certain messages from the body and expects them. When they are no longer appropriate, there is a perception of badness.