Did you push the filament through the filament sensor before the extruder?? That will throw an error like what you mentioned. Either disconnect the sensor or pass the filament through the sensor.
Checking the runout sensors and connected cables with a multimeter should help pinpoint the cause of the problem. The microswitch inside the filament sensor works as a simple toggle switch. The fine-tuning of the filament sensor can be achieved by slightly bending the lever of the microswitch with a pair of pliers.
Powering off & on the printer could result in resuming the last print job at the very same position (this is a feature, not a bug…) - removing the SD-card & deleting hidden files should prevent that kind of error loop.