Can anyone explain to me why this sentence is incorrect?
In 2016 I had gone to France for five years.
Why it should be had been going?
The problem with your sentence is the preposition in.
The past perfect continuous expresses the idea that an action began in the past and continued until another time in the past.
In your example, the preposition in confines the action to 2016. The prepositional phrase in 2016 is therefore not the right choice to express the idea that the action had been ongoing since 2011.
By 2016, I had been going to France for five years.
As of 2016, I had been going to France for five years.
I was 22 years old, and had been going to France for five years.
"... had been going" is actually not correct either, unless you mean to imply that you had taken a trip to France and it took 5 years for you to finally arrive at your destination.
The most correct way of saying this would be: "In 2016, I had lived (or resided/stayed) in France for five years."
This is because you really don't mean that the process of "going" to France took any specific amount of time. You mean that you stayed in that location for a time period.