Hi song.
Interesting, I was just singing a song. Just joking :)
Both sentences are grammatically correct, but they have slightly different meanings.
The original sentence “She stayed at home because she had no car” implies that the reason for staying at home was the lack of a car.
The Chinese version “She stayed at home not because she was ill but because she had no car” emphasizes that the reason for staying at home was not illness, but the lack of a car.
The sentence “She did not stay at home because she was ill but because she had no car” is grammatically correct, but it has a different meaning. It implies that the reason for not staying at home was not illness, but the lack of a car. This sentence is not appropriate in this context.
In summary, both sentences have the same meaning, but the Chinese version emphasizes the reason for staying at home more clearly.