Lattice QCD calculations of transverse momentum-dependent parton distribution functions (TMDs) in nucleons are presented, based on the evaluation of nucleon matrix elements of quark bilocal operators with a staple-shaped gauge connection. Both time-reversal odd effects, namely, the generalized Sivers and Boer-Mulders transverse momentum shifts, as well as time-reversal even effects, namely, the generalized transversity and one of the generalized worm-gear shifts are studied. Results are obtained on two different $n_f = 2+1$ flavor ensembles with approximately matching pion masses but very different discretization schemes: domain-wall fermions (DWF) with lattice spacing $a=0.084$ fm and pion mass 297 MeV, and Wilson-clover fermions with $a=0.114$ fm and pion mass 317 MeV. Comparison of the results on the two ensembles yields insight into the length scales at which lattice discretization errors are small, and into the extent to which the renormalization pattern obeyed by the continuum QCD TMD operator continues to apply in the lattice formulation. For the studied TMD observables, the results are found to be consistent between the two ensembles at sufficiently large separation of the quark fields within the operator, whereas deviations are observed in the local limit and in the case of a straight link gauge connection, which is relevant to the studies of parton distribution functions. Furthermore, the lattice estimates of the generalized Sivers shift obtained here are confronted with, and are seen to tend towards, a phenomenological estimate extracted from experimental data.