Agreement between Pronoun and gender

The following is a text from Mahāvagga, Vinaya:

‘‘Taṃ kiṃ maññatha, bhikkhave, rūpaṃ niccaṃ vā aniccaṃ vāti? Aniccaṃ, bhante. Yaṃ panāniccaṃ dukkhaṃ vā taṃ sukhaṃ vāti? Dukkhaṃ, bhante. Yaṃ panāniccaṃ dukkhaṃ vipariṇāmadhammaṃ, kallaṃ nu taṃ samanupassituṃ – etaṃ mama, esohamasmi, eso me attāti? No hetaṃ, bhante. Vedanā niccā vā aniccā vāti? Aniccā, bhante. Yaṃ panāniccaṃ dukkhaṃ vā taṃ sukhaṃ vāti? Dukkhaṃ, bhante. Yaṃ panāniccaṃ dukkhaṃ vipariṇāmadhammaṃ, kallaṃ nu taṃ samanupassituṃ – etaṃ mama, esohamasmi, eso me attāti? No hetaṃ, bhante. Saññā niccā vā aniccā vāti? Aniccā, bhante. Yaṃ panāniccaṃ dukkhaṃ vā taṃ sukhaṃ vāti? Dukkhaṃ, bhante. Yaṃ panāniccaṃ dukkhaṃ vipariṇāmadhammaṃ, kallaṃ nu taṃ samanupassituṃ – etaṃ mama, esohamasmi, eso me attāti? No hetaṃ, bhante. Saṅkhārā niccā vā aniccā vāti? Aniccā, bhante. Yaṃ panāniccaṃ, dukkhaṃ vā taṃ sukhaṃ vāti? Dukkhaṃ, bhante. Yaṃ panāniccaṃ dukkhaṃ vipariṇāmadhammaṃ, kallaṃ nu taṃ samanupassituṃ – etaṃ mama, esohamasmi, eso me attāti? No hetaṃ, bhante. Viññāṇaṃ niccaṃ vā aniccaṃ vāti? Aniccaṃ, bhante. Yaṃ panāniccaṃ, dukkhaṃ vā taṃ sukhaṃ vāti? Dukkhaṃ, bhante. Yaṃ panāniccaṃ dukkhaṃ vipariṇāmadhammaṃ, kallaṃ nu taṃ samanupassituṃ – etaṃ mama, esohamasmi, eso me attāti? No hetaṃ, bhante."

Why the “Yaṃ pana aniccaṃ…etaṃ mama, esohamasmi, eso me attāti” same for all five aggregates although vedanā and saññā are feminine gender and saṅkhāra is masculine gender, instead of “yā pana…yo pana…esā mama…eso mama… and so on”? Is there any grammatical reason behind this?

1 Like

Edit. Sorry didn’t read properly.

Maybe it only has to agree with dukkhaṃ?

The yaṁ is in the sentence which refers to that which is dukkham̐ etc etc. That which is suffering etc is no me, not mine, not self.
The yam̐ and eso are not directly referring to each of the khandas, but the characteristics of those khandas.

Here they are talking about vedanā which is feminine, so the adjectives for it i.e. niccā & aniccā are feminine. So this should normally be followed with “yā panāniccā dukkhā vā sukhā vā?” - dukkhā here would also qualify as an adjective and not as the substantive noun dukkhaṃ .