There should be no problem with the mathematics, but conceptually it’s not completely sound: after all, time is not a random variable. On the other hand, you could also take the view that you forget about uncertainties and simply approximate your function in an appropriate basis (which happens to consist of multivariate polynomials, specifically Legendre polynomials for the time variable), which is conceptually acceptable (I would say). In that case, you might even consider whether polynomials are suited to model the variation in time, or whether there might be another basis that is suited better. E.g., if there are jumps, kinks, or rapid oscillations in the time series for a fixed set of parameters, polynomials are not suited. If the variation in time is not well approximated by polynomials, the whole approximation will suffer.
The typical way to treat time-dependent problems is to first perform PCA on the output, identify the most important directions, and then create several PCEs to model the PCA coefficients (Nagel, Rieckermann, Sudret 2020). In this case, the time-dependent Sobol indices can even be computed analytically. PCA on the time series output can be interpreted as finding a custom-made “basis” for the time variable. Time-dependent Sobol indices are displayed e.g. in Fig. 6c of Nagel, Rieckermann, Sudret (2020) or in Fig. 8 of Wagner et al (2020).