It may be some third-party using these classes in their di.xml files and using those classes as well.
In Magento 2.4, following deprecated classes were deleted.
Magento\Framework\Search\Adapter\Mysql\DocumentFactory
Magento\Framework\Search\Adapter\Mysql\Mapper
Magento\Framework\Search\Adapter\Mysql\ScoreBuilder
Magento\Framework\Search\Adapter\Mysql\Query\Builder\Match
Magento\Framework\Search\Adapter\Mysql\Field\FieldFactory
Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder
Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderContainer
Magento\CatalogSearch\Model\Search\TableMapper
Magento\CatalogSearch\Model\Indexer\IndexerHandler
Magento\CatalogSearch\Model\Indexer\ProductFieldset
Magento\CatalogSearch\Model\Indexer\Scope\IndexTableNotExistException
Magento\CatalogSearch\Model\Indexer\Fulltext\Action\IndexIterator
Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver
Use below command to see the those overrides
php bin/magento dev:di:info "Magento\Framework\Search\Adapter\Mysql\Mapper"
Disable/Remove those overrides from the di.xml (Any preference/virtual classes/plugin) its self and delete those overrides file as well otherwise whenever setup:di:compile runs same error will come.
Check Magento doc as well for other classes and interfaces -
https://devdocs.magento.com/guides/v2.4/release-notes/backward-incompatible-changes/index.html