I had this issue earlier this year with my 2017 iPad Pro and couldn't figure out what was causing it. In the end it got sorted after I allowed the iPad's battery to run down fully so that it shut down, followed by a full, uninterrupted recharge. Haven't had the problem since.