Thanks Badger and others for your suggestions.
Based on your feedback I have tweaked the itinerary slightly.
I have added a extra night in Copenhagen which will allow us to explore some of the places a bit further afield that were mentioned.
We will stay in Narvik for one night as the train from Kiruna then bus to Svolvaer would make for a long travel day and we are keen to spend the afternoon in Narvik visiting the Narvik War Museum.
Added an extra night in Svolvaer. Also departing on a Sunday so ferry departure time is 12.45pm rather than 6am (on weekdays).
Reduced nights in Bergen and Oslo from 3 in each to 2 in each.
Our time in Flam will coincide with no cruise ships in port (according to https://www.cruisemapper.com/ports/flam-port-1361)
Copenhagen
Gothenburg
Gothenburg
Stockholm
Stockholm
Stockholm
Uppsala
Uppsala
Train (overnight from Uppsala to Lulea)
Lulea
Kiruna
Kiruna
Narvik
Svolvaer
Svolvaer
Svolvaer
Train (overnight from Bodo to Trondheim after catching ferry from Svolvaer to Bodo)
Trondheim
Trondheim
Boat cruise (Trondheim to Bergen)
Bergen
Bergen
Flam
Flam
Oslo
Oslo
Ferry (overnight from Oslo to Copenhagen)
Copenhagen
Copenhagen
Copenhagen
I am feeling pretty happy with this itinerary.
Thanks for your help.