Accuracy of time-dependent properties in electronic-structure calculations using a fictitious Lagrangian