jQuery dependency on a custom theme is not adding jQuery?
Solved The problem was in my .theme file where it was unsetting the core jQuery library.
The problem code:
function theme_js_alter(&amp;$javascript, \Drupal\Core\Asset\AttachedAssetsInterface $assets)
{
    unset($javascript['core/assets/vendor/jquery/jquery.min.js']);
}

Thanks to @AlfredArmstrong for providing the suggestion of reviewing the php files