I have had, and continue to have, my share of prayer that does not produce the results prayed for. The degree of success has increased dramatically and the reasons for failure have changed.
My early failed prayer was due to a failure to understand what prayer really is and a failure to understand God. Without really examining what prayer was, I “prayed” according to what I thought it was: asking God to do something. The idea behind such “prayer” was to convince God that the thing was needed or doing it would result in some benefit for him. It was really working to change his will. Begging and promising to do something for him were parts of the “prayer” if the need for the result was urgent.
As I see it now, God should be offended at such prayer. He might not be because he is so merciful and forgiving, but he would have every right to be. Such prayer treats him as one who withholds from us or extorts from us: both which are not even remotely part of his character. God gives freely and adds no condition.
The first major change in my prayer occurred when I came to believe that God was not withholding and that prayer was using the power and means he gives us to produce the results we are seeking. The failures I experienced in prayer then were for different reasons. Some failed because I failed to recognize the difference between the temptation to not believe and not believing. Not realizing what doubt was caused others to fail. Faith that was not working by love produced failure. I failed to receive because I asked amiss to consume it on wrong desires. Not asserting the authority God has given us resulted in failure too.
I still have prayers that have not yet succeeded and types of prayers that fail. I am working to learn why, make the changes, and be changed to perfect prayer to meet any manner of need of those around us.