Indeed. I politely raised an objection prior to the code test that I found work like this irrelevant. The company nevertheless told me it wants to push ahead with the homework.
I am glad that things worked out well for you.
I am glad that things worked out well for you.
But to answer your question: cancelling the recruitment process is totally fine. It's much better that you politely tell them now than go through the process and tell them later.