Well, Magento 2.4.2 doesn't get along very well with the installations inside subfolders. It will attempt to load your application from the <magento_root>/pub/ folder, unless instructed otherwise.
Please follow this thread frontend and admin not working magento 2.4.2 upgrade and check the instructions mentioned there.
Just change the composer default repo URL using the below command, also make sure your internet connection speed
composer config -g repo.packagist composer https://packagist.org
composer config -g github-protocols https ssh
It changes or sets the package repo to be used by HTTPS only.
This fixes any issues with local composer.json files too. No need to mess ...