Think about it,they leave. Not all,but most of them. The IDF bombs the entire Gaza making it uninhabitable. They take out as much of Hamas as they can. They go like "Refugees can return to Gaza freely,they can come back if they want."
But there isn't anything to come back to. The houses are all destroyed. The infastracture,the public services,their property has been demolished. They have no money to rebuild. The UN is not allowed in,the Red Crescent is not allowed in,other Arab countries are not allowed in. So what happens? They live. So they have kicked them out of Gaza