Your phone likely has physical damage to the screen and needs repaired. I don't know which page on the Motorola website gave you the error code or what the error code was, but just in case, here's Motorola's repair FAQ: https://en-us.support.motorola.com/app/repair-faqs/category/need-service-repair
If that page doesn't work, iFixit has some documents about repair for this device: [[Topic:Motorola Razr 40]]