I'm not sure on which operation the file was created (assuming mysqloptimize), but assume you have this temp file.
You restart the server.
You can repair this table by hand, everything looks fine. If you have a cron job that does a mysqloptimize -A at nighty, this operation fails, the table is marked as crashed. You get the message "... is marked as crashed and last (automatic?) repair failed" inside the log.
No automatic repair will work. Doing a repair by hand, will work, but will not remove the temp file, as it is not removed by a full server restart.