Islam believes in both good and bad destiny, meaning that everything that happens is a result of human choice and unfolds according to the destiny one has chosen. Therefore, the notion of altering the past is a distortion of faith and reason, as humans are inherently endowed with the ability to think rationally and logically.
In Islam, not a single leaf falls without being recorded. Therefore, our lives are not like a game of time that we can reverse at will; everything will be accounted for. A simple yet clear and firm explanation is that no matter how advanced a time machine may be, if Allah does not permit it, it will not happen. Thus, the concept of "changing the past" is entirely incompatible with how Islam views the issue of time.
Islam teaches that time moves forward, not backward, and destiny is inevitable, even if we try to change it. This means that humans are expected to make the best use of their time while they still have the opportunity to do good deeds before the allotted time runs out.
So, the Grandfather paradox is essentially just a logical game without a clear basis in reality. Humans cannot attempt to change or interfere with Allah's destiny. If you could go back in time and kill your grandfather, it would mean... that was his destiny. But your destiny would still be to be born, because Allah has already determined the course of all events.
Sometimes it is strange how humans tend to think too far ahead and tinker with time theories, which can be described as mere speculation or akin to daydreaming.