Just in case you don’t know the whole phrase from Robert Burns’ To a mouse it is:
The best laid schemes o’ mice an ‘men
Gang aft agley,
You could call it serendipity, or nappiting . . . . . . . or just plain getting diverted from one’s purpose. And as for the origin of “nappiting” you’re on your own, horror of horrors I can’t find it on google. I think it is an old Scots word meaning doing things other than you should be doing.
All this is just an introduction to a glimpse of today, when I got diverted from housework and followed the sunshine. Neighbours cried out, “What’s that yellow thing in the sky?” And everybody smiled.