That depends on your kidney function. According to scientific analysis, the human body is 98% made up of water. Drinking more water is not just the inertia of going to the toilet.
There is no harm. If you want to sleep through the night without going to the bathroom.
Then don't drink too much, just add some water according to your lack of water.