HSK6 Standard Course: Does the sentence 她的脾气不好，经常不知道为什么突然就生气了 violate the textbook's own grammar rule regarding inconsistent subjects? The HSK6 textbook has this example of the inappropriate use of a subject.



(✗) 他向国家捐献出了一张祖传的字画，具有极高的研究、保存价值。

主语残缺。前一分句的主语是“他”，后一分句的主语是“字画”，暗中更换了主语，致使后一句缺少了主语，应改为“这张字画具有极高的研究、保存价值”。
HSK标准教程6级上，51页。

It argues that it's incorrect because the sentence begins with the subject 他, and switches to another subject (i.e., 字画) without declaring it.
I'm interested in applying this grammatical logic to the following sentence from the same textbook (it's intended to be a grammatically correct sentence):


她的脾气不好，经常不知道为什么突然就生气了。
HSK标准教程6级上，90页。

In particular, the subject in the first part of the sentence is 她的脾气 (&quot;her temperament&quot;).  If I were to apply the above logic to the second part of the sentence, the subject of the second part remains 她的脾气, so it should be translated as:

Her temperament is not good, [and] [her temperament] often doesn't know why [it] suddenly gets angry.

There might be some reason why the above grammar rule doesn't apply here, but I don't see why.  To me, it looks like it violates its own grammar rule, but it'd be nice to check this.
Question: Does the sentence 她的脾气不好，经常不知道为什么突然就生气了 violate the textbook's own grammar rule regarding inconsistent subjects?
她的脾气不好， (她)经常不知道为什么突然就生气了

The above are two independent sentences in a comment
sentence 1: [她的脾气]不好 (她的脾气 is the subject)
sentence 2: [她]经常不知道为什么突然就生气了 (她 is the omitted subject)
The subject 她 in sentence 2 is omitted because both sentences are the comment of an implied topic '她' (both sentences describe '她')
topic: 她 (implied)
comment 1: 她的脾气不好
comment 2: (她)经常不知道为什么突然就生气了 - 她 is omitted because it is the same subject in the implied topic 她
To unite the two sentences, we can make '她' the only subject

她脾气不好，经常不知道为什么突然就生气了

'她' is the subject of both 脾气不好 and 经常不知道为什么突然就生气了 therefore no need to repeat it
Edit:
她脾气不好 and 她经常不知道为什么突然就生气了 are closely related in logic, therefore, we can presume they are comments on the same topic/subject.
If the two comments are not closely related, we might not be allowed to omit the subject 她 in the second sentence, even both sentences are comments on the implied topic 她
Example:
她的兒子今年三歲，她在中學教書
If you omit 她 in the second sentence and wrote &quot;她的兒子今年三歲，在中學教書&quot; It would mean her three years old son is teaching at middle school