The Prophet ﷺ used to pray Maghrib the moment the sun set, as soon as its upper edge disappeared.
حدثنا عمرو بن علي عن صفوان بن عيسى عن يزيد بن أبي عبيد
كان النبي ﷺ يصلي المغرب ساعة تغرب الشمس إذا غاب حاجبها
Sourced from Bukhari, Prayer Times, chapter on the time of Maghrib, no. 561, and Muslim, Mosques, chapter clarifying that the earliest time for Maghrib is at sunset, no. 636, from the hadith of Yazid bin Ubayd, with the same wording.