Is there a term for solving a sub-sub problem of a problem so far removed from the main problem the link is not clear?

Solution 1:

You’ve gone down a rabbit hole.

See this ELL answer: https://ell.stackexchange.com/a/116548/43624 by ohwilleke.

The idiomatic expression, a "rabbit hole" is a reference to Lewis Carroll's "Alice in Wonderland". Its modern meaning is a detour from your work efforts that will require a great deal of time and analysis, while producing no useful result. It is a dead end or a fool's errand. A June 4, 2015 article in the New Yorker magazine recounts the evolution of the phrase over time.

Solution 2:

I suppose you could say you got off in the weeds. I can't find any authority for this but it's a common enough expression. The implication is that you've wandered off the main path.