Assume the variables are correctly populated, the recordtype is not being hnored and returns all types that match that name. Are name and type mutually exclusive?
Have you tried without the variable first ? From the test the record type is honor.
curl "https://api.cloudflare.com/client/v4/zones/--Redact--/dns_records?type=A&name=spf_record_in_txt.Redact.xyz&match=all" -H "X-Auth-Key: --Redact--" -H "X-Auth-Email: --Redact--" | jq | grep -i type
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 562 0 562 0 0 601 0 --:--:-- --:--:-- --:--:-- 601
"type": "A",
curl "https://api.cloudflare.com/client/v4/zones/--Redact--/dns_records?name=spf_record_in_txt.Redact.xyz&match=all" -H "X-Auth-Key: --Redact--" -H "X-Auth-Email: --Redact--" | jq | grep -i type
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1068 0 1068 0 0 1098 0 --:--:-- --:--:-- --:--:-- 1098
"type": "A",
"type": "TXT",
If not honor then you need to check your variable.