I have the next sentence in the book:
締め切りに間に合う『?』必死でレポートを書き上げた。
1)ために 2)ように
The answer is ように. But from my point of view, there is absolutely no grammatical difference between the 2 of them in the current sentence, and ために could be used as well. Because you're expressing your aim -> 締め切りに間に合う.
I also went through this article https://www.wasabi-jpn.com/japanese-grammar/how-to-express-aims/ to read about the difference between them and didn't find anything that will "stop me" from using ために. In this sentence.
Why it's wrong to use ために here?