I had the same issue, just trying to follow the 'Simple Notepad Automation' tutorial in AutoIt Help. I think Jos' answer is the solution. After typing something in notepad the title changes from "Untitled - Notepad" to "*Untitled - Notepad" (the '*' indicates you have unsaved changes). So you need to change the WinClose command to:
WinClose("*Untitled - Notepad")
And then it works.
The AutoIt Help should probably be updated to reflect this?