:
;;;###autoload
(with-eval-after-load 'optional-dependency
(cl-pushnew 'sns-var optional-dependency-var))
Instead, you must expand the shorthand symbol into its full form:
;;;###autoload
(with-eval-after-load 'optional-dependency
(cl-pushnew 'some-nice-string-utils-var optional-dependency-var))
For a real-world example, see
https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d