Probably the offering sector had you on a heading to provide separation against traffic in their airspace and when you were clear of conflict then sent you own navigation to the next waypoint. The receiving sector then obviously needed you on a heading against traffic that was unknown to the transferring sector. Personally,if I have traffic on a heading pointing in generally the right direction,I transfer it on the heading to avoid situations as you have hilighted.After 40+ years only 26 working days to go!