Hugo generating language version where none exists

My blog has a recent post written in Portuguese. The default language is English, and Hugo is also generating a link to an english version that should not exist.

The code queries the posts with this statement:

{{ $list = (where (where .Data.Pages ".Params.options.unlisted" false) "Section" "!=" "instagram") }}

Since it uses .Data.Pages shouldn’t that avoid the issue of having a portuguese post in what is an english section?

I figured out that this is happening when there is a slug param in the post. I think it should be considered a bug but I will leave that decision to someone that knows more of Hugo than me.