Why does fingerprint sensor not work when phone is charging?
As requested by OP posting answer, in response to my comment (now deleted) based on my experience 


  Having a clean power supply, using original charger + USB cable, setting up finger prints again are the common things that work...


I am not  sure as to why touch sensor  works only with original charger but posting as it may help, as it helped OP