When you upgrade or downgrade PHP Version of Laravel Valet it creates this issue of getting
502 Bad Gateway Error while accessing any parked .test domain.
Simple way to solve this by updating composer first.
composer global update
Once done reinstall Valet again. It takes very less time.
Run this command to make sure that you use correct version of php
valet use firstname.lastname@example.org