Vgs needs to have a certain positive value for the NMOS to work...and if the transistor drain is connected to Vdd and its source is connected to the output, then the voltage on the source is unknown and the value of Vgs isn't necessarily the voltage needed for the correct operation of the device....so it won't work
I presume that you are talking about the case where you have incidentally interchanged the nmos and pmos...
IT WILL WORK.......
sounds contradictory??
So lets be more specific, it works but not as an inverter and even not as a buffer(since output is degraded)...The output swing is only limited to the range...
|VTP| <VOUT<VDD-VTN