Why is there a discrepancy between the diary workout values and the map?

Problem: When you import a route. you can merge the course into the map and add a diary entry. When you choose to merge the course into the map the course of the route will be aligned to existing tracks. This means that the route will be modified and some values like elevation data or the exact course might become different to the raw data from the GPS. The diary entry instead stores the raw data. If you later compare them, they might differ slightly.
Solution: Please keep in mind that workouts are meant to be stored in the diary and not in the map. The map is the base for planning future routes and by merging route courses into the map you complete your network of tracks more and more. In the long run, workout information like heart-rate and speed isn't of any interest in the map. But in the diary, it naturally is. 
Tip: If for some reason you really want to archive workouts and routes in the map, then you should import the courses in one piece and select TrailRunner > Preferences > Advanced > Store workout data in the map. This will not alter the course of a recorded route (but also will not add crossings or remove redundant tracks) and will keep the workout data persistent in the map.