Sure he was mocking Isaac, but isn't that normal to some degree. Wasn't he just parroting the behavior he had certainly seen in his mother. Sometimes we are innocent players in a tough circumstance. There are a host of things that happen in life that we have not asked for or deserved. Sometimes the difficulties of life come upon us and we don't know why.
Difficult times happen.
God seemed to be telling Abraham to sever his ties with Hagar and with his firstborn son. I don't know. God may have known that there would always be conflict. He may have seen that Isaac would not be able to serve as he needed to if Ishmael was around. Maybe God saw that Abraham's heart was divided.