First of all I would suggest that yo check the power-key for any kind of dirt or moisture. This as dirt or moisture as well as the condition of your skin, such as cuts, dryness, or moisture may have an effect on the fingerprint recognition rate.
As @uliwooly mentioned, there is also a test in the support app that you can try doing in order to test the functionality of the fingerprint sensor.
Using the fingerprint manager that you find by going to Settings > Lock screen & security, you can also try adding your fingerprint again. you can register a fingerprint up to five times to improve the recognition rate of the fingerprint sensor.
If none of these measures work I would suggest that you try re-booting your phone to safe mode and see if the fingerprint sensor behaves differently. All apps downloaded from Play store is temporarily deactivated and by doing this you can see if it is a downloaded app causing this. For more information on safe mode and how to use it, click here.