No it isn't.
My only explanation now is that your script file is perhaps larger than the 3 lines you posted, and that somehow you change the OnConnect variable to something else. For example:
function OnConnect ()
print "connected"
end -- OnConnect
--- 500 lines of code here ...
OnConnect = {}
Now that code gives the error message "The world connect subroutine named "OnConnect" could not be found." - this is because OnConnect is now a table and not a function.
One thing you could try is, after processing the script file, and seeing the error message, go into the immediate window and type:
After mucking up the script file (as above) it printed "table".
It should be "function". Or maybe it would print "nil".