This is a very good question. The two events are connected in the sense that on both occasions, Atticus is forced to do something that he would have preferred not to do. Concerning the Tom Robinson trial, Atticus told his brother, Jack, that
"... John Taylor pointed at me and said, 'You're it.' "
Judge Taylor appointed Atticus to take the case and, though he could have turned it down, he--like Judge Taylor--realized that he was the only man for the job.
The same can be said for the situation with Tim Johnson. Atticus hated guns, and he was not proud of his past marksmanship skills. But Sheriff Tate
... almost threw the rifle at Atticus...
leaving Atticus with little choice in the matter. This time, it was Sheriff Tate who came to Atticus because he knew he was the right man for the job.