Hi Rui Cunha ,
Thankyou for putting effort and sharing the approach for resolving the issue.
Glad that you figured out the way to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
YAML version needs to be compatible with the spark config. By upgrading the version and changing the task from "synapse deployment task@0" to "synapse deployment task@2" , it resolved the issue and the deployment was successful.
Kindly accept the answer by clicking on Accept answer
button so that the solution reaches the community in case anyone is facing similar issue. Thankyou.