Maybe try studying some improvising theory, like learning scales and arpeggios and putting them in patterns and using them to create variations and that might help you recover from what you may perceive as a mistake, but actually is just a doorway to another variation/ornament/version