Usually it is absolutely fine and many people do this. Most airports will close down between 0000-0430 on average when there are no passenger flights scheduled. But you will likely see many other longhaul passengers around the terminal building, sleeping in lounges and waiting areas.