Why are some vertical stabilizers painted 'after' installation?
The most important safety consideration when painting the tail of an aircraft is balance of the flight control surfaces to prevent flutter. This means painting of the stabilizers can happen whenever the manufacturer finds it most convenient, since they are not flight controls. 

Flutter begins when the support structure of a flight control is displaced and the control is unbalanced, ie. heavier behind its hinge line. In an aileron, which is the flight control most sensitive to flutter, a gust might displace the wingtip upwards. The unbalanced aileron, heavy behind the hinge, deflects downwards due to inertia. This increases lift amplifying the effect of the gust. When the structure flexes enough to reverse the excursion of the wing, the aileron continues to rise due to inertia and deflects upwards. This reduces lift on a wing that is already descending, amplifying that motion. Uncorrected, this develops into an oscillation of increasing amplitude until structural limits are exceeded and the structure fails.



One less efficient way to deal with the weight of paint is to overbalance the flight control, meaning make it heavier ahead of the hinge line. This prevents flutter from developing because all the inertial effects on the control run counter to the deflection of the supporting structure. It is less efficient because there is unnecessary weight in the control, but it does mean that you could theoretically calculate paint weight and add some margin to ensure that overbalance is maintained after painting. Airliners don't take that theoretical route due to regulation and desire for efficiency.

Painting/repainting of the rudder, elevator and ailerons in commercial airliners always requires balancing of the control surface. This means that the mass of the control ahead of the hinge line equals the mass behind the hinge line. On a b737, the rudder can be balanced while installed on the aircraft. The horizontal stabilizer can also, but in a more restricted manner. Ailerons have to be removed, as they are most sensitive since their support structure (the wing) flexes far more than the aft fuselage where the other controls are located. 

For both your aircraft all the controls will be balanced prior to flight. The A350 apparently allows balancing of the rudder while installed on the aircraft, just as the B737 does. This means it does not need to be painted prior to installation, and the manufacturer is indifferent to any cost differential.