Is Webform using datepicker.js?
Webform provides a fieldable form entity type. And when you add a date field to it (you didn't specify what date field exactly, core, contrib, custom), this date field may make use of a datepicker library.

Speaking of core it most likely is core's core/jquery.ui.datepicker library. Which is used for #type =&gt; 'date' form elements for example.

When you in your custom script want to make use of this datepicker library you need to add it as a dependency. Same as core does:


drupal.date:
  version: VERSION
  js:
    misc/date.js: {}
  dependencies:
    - core/drupal
    - core/modernizr
    - core/jquery.once
    - core/jquery.ui.datepicker



See https://git.drupalcode.org/project/drupal/blob/8.8.x/core/core.libraries.yml#L142-150.



And maybe you also make your JavaScript look more like in the examples in the docs.