When it's a happy accident.
I think the first time I heard a "mistake" referred to as a "happy accident" was watching Bob Ross on his Joy of Painting show. It's a phrase I thing of every time something doesn't go quite as I planned. And yes, that's a lot.
Sometimes of course the mistakes are not very happy, like knocking a cup of tea over an almost finished watercolour. It is a lesson learned though and my drinks are kept well away from my work space.
This picture is one of my happy accidents. I took quite a few pictures at different angles and of different webs, all the time trying to get an area of sharp focus. On this one, a breeze moved the web and none of it is in sharp focus. However, it's my favourite shot of today because it has a lovely serene quality. The individual drops of water don't distract from the whole composition but map out the web in a subtle way.
This second picture is more what I was aiming for, but for me, it doesn't quite have the charm of the one above. It is a good reminder to look more with the eyes of the artist than with the eyes of someone looking for technical perfection.
The thing with being an artist is you make mistakes, lots of them. The important thing is not to dwell on them. Learn the lesson, make the change, move on.
All the best,