You will get an error if Flash Fill cannot find the pattern. The first thing to check is that you're using Flash Fill close to the source data (e.g., in the adjacent cell). For instance, it won't work ...
Microsoft's spreadsheet program can do way more than you might imagine. These are the hacks and tricks you need to know.