Why does composer remove a folder it doesn't manage
It isn't Composer, per se, that's removing your hacked gesso theme. Drupal uses the composer/installers Composer plugin to move different Drupal components (e.g. modules, themes, profiles) to the dir where Drupal needs them.
Once Composer has retrieved the drupal/gesso package, composer/installers will place it the contrib theme path in extra.installer-paths, thus overwriting your pre-existing hacked theme.
If you don't want Composer &amp; the installers plugin replacing your hacked gesso theme, you could do a couple of things:

Remove drupal/gesso from Composer management so it never tries to update or manage the theme again and add the hacked theme back to its previous location.
Use the cweagans/composer-patches Composer plugin to patch the drupal/gesso theme with your component/template hacks so they're added with every update.