I just had a cavity filled that was really close to a nerve. I could feel my tooth hurting during the procedure and evenafter that. The filling is moving and is falling out. Is itnormal?

Normal. Every time the dentist drills on a tooth there is trauma to the nerve the closer the decay is to the nerve the more trauma. It is normal to have some pain after the treatment is finished. You should be concerned if the pain is getting worse, waking you up at night, or if you are unable to eat on that side after a week or so. I usually tell my patients to give it a week.
Yes, normal.. .. In regards to the pain, not a moving filling. Your dentist needs to take a look at it. Please call for an appointment.
Yes. It depends on the pain deep or any filling could have sensitivity to cold or hot but should go away within seconds after swallow if it lingers for a minute this is not a good sign. The filling should not move or fall out that is not normal.