Where was the error in communication?
Without wishing to appear too critical (such open honesty and critical evaluation of our own performance is what makes us professionals), ATC's subsequent instruction to "maintain runway heading" is correct standard phraseology and such a clearance supercedes a the previous SID clearance.
It seems that perhaps the error made was solely on your part, in assuming that an instruction to maintain rwy hdg was a 'rebuke', rather than a valid ATC instruction.
Well done for monitoring those automatics and taking appropriate action when they were not behaving as expected - failure to do that has killed many people before now. Has an impact on the workload, though, eh?
I don't understand how the hdg bug slaving affected the outcome of the situation, other than to cause you workload issues early in the departure. I've never flown the BE20.