The Messenger of Allah ﷺ used to perform the witr prayer at the beginning of the night, in the middle of it, and at the end of it. Eventually, he settled on performing it at the end of the night.
حدثنا محمد بن فضيل حدثنا مطرف عن أبي إسحاق عن عاصم
كان رسول الله ﷺ يوتر في أول الليل وفي وسطه وفي آخره ثم ثبت له الوتر في آخره