Umar was mistaken. The Messenger of Allah ﷺ only said, "Do not deliberately schedule your prayers to coincide with sunrise or sunset, for the sun rises between the two horns of Satan."
أخبرنا محمد بن عبد الله بن المبارك المخرمي قال حدثنا الفضل بن عنبسة قال حدثنا وهيب عن ابن طاوس عن أبيه قال
أوهم عمر رضي الله عنه إنما نهى رسول الله ﷺ قال لا تتحروا بصلاتكم طلوع الشمس ولا غروبها فإنها تطلع بين قرني شيطان
Muslim reported it in "the Prayer of Travelers," chapter "Do not deliberately time your prayer with the rising or setting of the sun," hadith no. 833, from the hadith of Wahib through him, and it is also in Sunan al-Kubra, hadith no. 370, in abridged form.