Let's suppose I have two finite lines of charge, each of them at some voltage $V$. The first one would be at $x=0$ and the second one at $x=a$, and each of them has the same length $l$.
If I want to calculate the electric potential map I would have to solve the Laplace equation with the boundary conditions $V$ at $x=0,a$. Naively I could say that I can calculate the electric potential map of the line at $x=0$, then do the same with the other one and add them together. This would be wrong, because after calculating the field for the line at $x=0$, $V(x=a)>0$, and when I add the field of the second line, $V(x=a)>V$, which would violate one of the boundary conditions of the problem.
However, if I am given both lines and their respective voltages and asked for the electric field potential at any point, I can use the superposition principle and add the contribution of each one separately.
Why can I use the superposition principle in the second scenario but not when calculating the electric potential map?