On the return, take the 17:00 train from Marrakech to L'Oasis. There is no need to go all the way to Casa Voyaguers for the connection as the web site suggests, as you would just retrace the route through L'Oasis anyway. This will give you a 12 minute connection to the airport train, with two later trains to the airport if the incoming is delayed (not unusual).