Many scholars of Tafseer say that Allah (SWT) called the Prophet Muhammad as O Messenger in very important matters which are related to conveying the message of Islam (Osool Al-Deen) while called him as O Prophet in matters which are related to day to day rules and regulations (Foroo' Al-Deen).
Wassalam.