Really? No native English speaker would ever say this. One might say "After I did my homework, I went for a walk" but that doesn't mean what I think the question writer is after.
Having had to do something is a state of being, not something after which one takes a walk. Consider a work around to what is said: "After being in a position where I was required to do my homework, I took a walk." Weird, awkward, unidiomatic, and just strange. If this question was written by a native English speaker, it was surely in pursuit of teaching the plupurfect of devoir, which I never hear in conversation. It is something taught but in my experience never used and really never needed. Apparently, whatever exists on the conjugation chart has to be worked into a question....
When I took French in 60s, the pluperfect of devoir was translated as "must have", but I only hear the passe compose in cases where the pluperfect might have worked. Again, I never hear this said and rarely written.
Anyway you look at it, devoir in the past is a condition - not something that happens before something else happens. So no more is needed than the passe compose IMO.....