Which passport do I present to the (Canadian) airline? Canada now insists that Canadian citizens fly with a Canadian passport. Presumably I need to show my UK passport to work legally in the UK. Can I travel on the Canadian passport and show the UK one to the UK Immigration agent, or will that cause confusion and delays?
What you suggest will work just fine.
The airline only cares that you present them a passport that allows you to enter the country you are flying to. UK immigration wants to see a passport that allows you to work in the UK (if that's what you are going to do - if you were going as a tourist your Canadian passport would be fine). Coming back the airline wants to see a passport that allows entry to Canada, and Canadian immigration wants a passport that proves you can live there. Neither of the immigrations care what passport you showed to the airline.
You could also use your UK passport for everything on the outward journey and the Canadian one on the return, although that would involve providing two passport numbers to the airline, which would be unnecessarily complicated.