When you ask something with 'why', you can anwer with 'when'?

Solution 1:

I believe the child is just misinterpreting the question a bit. The detective asked "why", but the child interpreted this as meaning "under what circumstances".

Or he could just be phrasing the answer poorly, meaning "Because I have to go."

All these concepts are easily conflated, especially by a child in distress.