Is above average number of years spent on PhD considered a red flag in future academia or industry positions?
It's well known that there is a significant amount of variability in the time that it takes for a student to finish a PhD, particularly in programs with more rigorous standards. My own graduate department, for example, preferred people to finish in 5-6 years, but was somewhat infamous for allowing some to take as long as 10 years.

In fact, I would venture to say that it is the opposite. I would typically consider it a red flag if somebody took a shorter than usual amount of time to obtain their Ph.D. Typically if you have a really good student, you don't graduate them faster, but instead you graduate them in the normal time but with a much stronger portfolio of results. Shorter-than-usual Ph.D. studies, on the other hand, are typically a sign of somebody rushing to depart the program by meeting the bare minimum of requirements.

Bottom line: if you've done good work and have good publications, the fact that you took one more year than is typical for your department will barely even be noticed, let alone held to be significant. This is even more true for most industry jobs.

If somebody does actually ask you, however, focus on the first of your reasons (time spent figuring out an appropriate area of focus) rather than the latter reason (time spent working on out-of-work projects), as the second may be of legitimate concern to future employers.