The easiest workaround is to use
Table[Labeled[
ListVectorPlot[data[[i]], PlotRange -> All,
VectorColorFunction ->
Function[{x, y, vx, vy, n},
ColorData["Rainbow"][Rescale[n, {min, max}]]],
VectorColorFunctionScaling -> False, ImageSize -> 300],
BarLegend[{"Rainbow", {min, max}}, ImageSize -> 300],
{{Right, Center}}
], {i, 1, 2}]

This is probably the correct way to specify the BarLegend
for the given situation:
Table[ListVectorPlot[data[[i]], PlotRange -> All,
PlotLegends ->
BarLegend[{ColorData["Rainbow"][Rescale[#, {min, max}]] &, {min, max}}],
VectorColorFunction ->
Function[{x, y, vx, vy, n}, ColorData["Rainbow"][Rescale[n, {min, max}]]],
VectorColorFunctionScaling -> False, ImageSize -> 300], {i, 1, 2}]

Alternatively one can add the option ColorFunctionScaling -> True
to BarLegend
. This option is undocumented for BarLegend
and will be highlighted in red in the FE.
Table[ListVectorPlot[data[[i]], PlotRange -> All,
PlotLegends -> BarLegend[{"Rainbow", {min, max}}, ColorFunctionScaling -> True],
VectorColorFunction ->
Function[{x, y, vx, vy, n}, ColorData["Rainbow"][Rescale[n, {min, max}]]],
VectorColorFunctionScaling -> False, ImageSize -> 300], {i, 1, 2}]
Explanation:
You specified the BarLegend
in the format you wanted it to be displayed.
However, as stated in the documentation,
BarLegend
automatically picks up values of ColorFunction
and
ColorFunctionScaling
.
For your specific case this means that your BarLegend
gets replaced by
BarLegend[{"Rainbow", {0., 12.7279}}, Legending`LegendDump`options$2394]
with Legending`LegendDump`options$2394
being an internal value that picked up ColorFunctionScaling -> False
from the rest of the input (the number at the end will be different each time the input is evaluated) and subsequently BarLegend
becomes
BarLegend[{"Rainbow", {0.`, 12.727922061357857`}},
Sequence[LabelStyle -> {}, LegendLayout -> "Column", LegendMarkerSize -> 300,
Charting`TickSide -> Right, ColorFunctionScaling -> False]]
