The problem was solved after examining my code again. I’ve worked with a custom table in the past. Due to difficulties I had retrieved the fields with post_name (‘field_5f4005dc755c5’) and not with the field name (‘deathdate’). I have now re-saved the posts. After saving, I could now retrieve the field values with the field name again, and now the custom fields appear in the taxonomy output! Although I don’t know why it was related to the URL parameter, everything works now. Please excuse the confusion 😉