The third mark of existence states sabbe dhamma anatta - all phenomena is not self.
Despite that, the following sutta states that there is a self-doer (attakārī). Also, this implies free will.
How is it that the existence of the self-doer (and free will) does not conflict with the third mark of existence?
“So, brahmin, when there is the element of endeavoring, endeavoring beings are clearly discerned; of such beings, this is the self-doer, this, the other-doer. I have not, brahmin, seen or heard such a doctrine, such a view as yours. How, indeed, could one — moving forward by himself, moving back by himself — say ‘There is no self-doer, there is no other-doer’?”
AN 6.38 (translated by K. Nizamis)
“Brahmin, if there is this element of approaching, brahmin, then it is evident then that beings are approaching: this is what beings do themselves [self-agency], this is what is done by others [other-agency].” “Yes, sir.”
“Brahmin, I do not hold such a doctrine, such a view [that there is no action of one’s own, that there is no action by others]. For, I have neither seen nor heard of a situation where one could oneself step forward or one could oneself step back, and yet say, ‘There is no action of one’s own, there is no action by others.’”
AN 6.38 (translated by Piya Tan)
“Since there is an element of energy, and sentient beings who have energy are found, sentient beings act of their own volition or that of another.
Brahmin, may I never see or hear of anyone holding such a doctrine or view! How on earth can someone who comes and goes on his own say that one does not act of one’s own volition, nor does one act of another’s volition?”
AN 6.38 (translated by Ven. Sujato)