When I try to activate the code on Steam / Ubisoft Connect I receive a message that the code is invalid
This usually means that the code could not be recognized by the platform.
Make sure you are activating it on the correct platform (e.g. Steam, Ubisoft Connect, Epic). You can use the Activation section in product description for reference.