
The whole reason why Avery's disguise as a man worked for so long is because she was taught to keep dyeing her hair brown. I think her aunt probably resents the fact that Avery would be able to inherit as a woman/as her younger brother's child whereas she was unable to do so as the Duke's oldest daughter.
The reason why Avery can inherit the duchy is because she's the child of the youngest son (since the Countess murdered her older brother first). Meanwhile her aunt married into another family, thus leaving her family name behind. It might've been different if she had remained unmarried and then both of her brothers had died. However she did, so - assuming her brother had died childless - her kids would then be the first in line for the Dukedom. She didn't know about Avery so without Avery's existence, her oldest son would have become the Duke's heir since he's the Duke's grandchild.
To put it in simpler terms here is the priority of who would inherit if all the siblings and their children were alive:
- Oldest Son's children
- Younger Son's children (Avery)
- Daughter's sons (Countess; Matthew/Ben)
So if both sons and their children had died only then would the countess's sons be eligible to inherit since thats the only living blood for that family left. Since Avery is alive, the countess's sons have to be content with their father's count status unless they somehow manage to do something worthy of increasing their rank.
Sorry for the long comment but I hope this helps! The heir thing was very confusing for me for awhile too! ╮( ̄▽ ̄)╭

I think this might be because the fiancee was the only child of her family. Like @Kaisen pointed out, if the aunt had remained UNMARRIED and her two brothers died without children, then she would inherit the title as the only surviving blood.
In the same way, I think the fiancee was the only child of the family, or at least, the only child able to inherit.
Also, that problem has more to do with retaining titles. It has been established that two personages of the peerage cannot marry and both retain their individual titles. One of them would have to give up their pre-marriage titles, and usually this is the woman. Instead of being Lady------, daughter of a Baron (for example), she would have to take her husband's title. For example, Countess (insert husband's last name) instead.
Rarely, but not impossible, is the man giving up his pre-marriage title. We see this with Queen Victoria's husband, Royal Consort Albert. He was in line to inherit the Duchy of Saxe-Cobourg and Gotha (he only had one older brother, so if that brother passed away before marriage, he would have been able to inherit). Royal Consort Albert gave up any rights to inherit the Duchy when he married Queen Victoria.
I know this is rather lengthy, but I hope this helps!
I think there's a major plot hole here, I think this was all kind of unnecessary since the aunt couldn't inherit the title despite being the 1st child because she was born as a woman. Then isn't it natural to assume that Avery won't be inheriting the title as well, regardless if the will of the grandfather states that the offspring of the 1st son will be the future heir? And isn't she endangering herself by disguising herself as a man? Because if she really was a man, then she would be eligible to inherit the title, making her an even bigger threat. While I do understand that men and women aren't given equal opportunities, living as a man definitely benefits her in the sense that she knows how to survive in the real world, I think it just overrides the point of her mom protecting her. If her mom really wanted to protect her, she should've given her at least a fake name (albert's parents should have given them a fake family background information too for good measure) and had her stay in the manor as a maid. But idk that's just me ig