If Allah knows that what I am asking for is not good for me, why can't He change that bad outcome and give that thing to me since He has power to do anything?
Allah (SWT) Has created every thing according to systems which are unchangeable. When something is bad, it remains bad. Allah does not change the bad into good. We have to tolerate and be patient and never try to impose our wishes in the Wisdom, Knowledge and Mercy of Allah.
Wassalam