If the command line PHP version is 8.3 and Composer is run over the CLI, it should only install extensions and dependencies that work with PHP 8.3.
A problem can occur if your CLI PHP version was upgraded to 8.4, then Composer will upgrade everything even if the webserver doesn't actually run 8.4.
Depending on your setup, it's also possible Composer uses a completely different PHP version than the CLI (can be checked with composer --version). In that case you should either search where this version is configured / ask your hosting support, or you could hard-code a platform constraint in composer.json to instruct Composer to only download dependencies for a specific PHP version even if Composer runs with a different one.
If you encounter further problems, make sure to note the date and time of the last change, or delete/rename old log files, so you can be certain that every error message you see is related to the new problem and not one of the previous problems.