Depending on which gospel harmony one consults, there are about 150 - 180 incidents that the four gospels record. More than half of these are recorded by more than one evangelist and every case, there are variations between the recorded accounts due to one or more of the following causes:
- the different purpose/audience for which the gospel was composed
- different viewpoints or different sources that the evangelist used
- the incident recorded are never complete but always summaries of the events cited. This means that some details are always omitted and some evangelists included some details and omitted others while another author made a different selection
- sometimes the two (or three) different recordings of an incident, are both correct because it is only a combination of the records that make the story complete.
This bothers some people but actually gives me confidence as it demonstrates that the four witnesses were have (Matthew, Mark, Luke and John) were truly independent, and despite this, their story is consistent and thus reliable.
Now, to the specifics of the minor difference between Matt 17:17 and Luke 18:19 is possibly due to one of several things:
- Matthew and Luke understood differently
- The man questioning Jesus and Jesus almost certainly said more than has been recorded, and may have said BOTH things as recorded - but Luke recorded one thing and Matthew recorded the other.
Thus, there is no real contradiction. It is quite possible Jesus said something like, "Why do you ask me about what is good and call me good?"