I've found out a bit more about why the taskkill command does not always work. If there is more than one instance of the browser open, only the one that Windows perceives to be active shows up in the task list. So if the browser App is minimised or you switch focus to another browser window, it 'dissappears' from the task list and the taskkill command fails.
Unfortunately I haven't found a workaround yet!