The Messenger of Allah ﷺ used to pray Witr at the beginning of the night, in the middle and at the end, then he settled on praying Witr at the end of the night.
كَانَ رَسُولُ اللهِ ﷺ يُوتِرُ فِي أَوَّلِ اللَّيْلِ وَفِي أَوْسَطِهِ وَفِي آخِرِهِ ثُمَّ ثَبَتَ لَهُ الْوَتْرُ فِي آخِرِهِ