I had the same problem, and managed to resolve it. It is indeed caused by Yoast, but more specifically, the “Remove unregistered URL parameters” setting in Yoast.
To fix the issue, go to Yoast -> Settings -> Advanced -> ‘Crawl optimisation‘ and find the setting “Remove unregistered URL parameters“. You can turn this setting to ‘disabled’ to fix the issue, or alternatively you can add the parameter ‘key’ (sans quotes) to the ‘Additional URL parameters to allow’ section.