Hi Jolas,
Do you mean that you were using "Test send" to send DOI email and then encountered error?(As screenshot below:)

If above would be your situation, as documentation said, Test send couldn't be used to send DOI email.
https://docs.microsoft.com/en-us/dynamics365/marketing/double-opt-in#create-a-subscription-confirmation-request-message

To test DOI process, we should build a subscription center, add subscription lists and consent level field form field to the form of page,
then run a simple customer journey to make it work.
Process:
1. Create a subscription center type form -> 2. Create a subscription center marketing page, add the form to the page ->
3. Create a test email, add the link to subscription center to email -> 4. Create a static segment, add your test contact(yourself) to it ->
5. Run a customer journey, add the segment to the journey to send marketing email -> 6. When you received the test email, open the page via link of the email ->
7. In subscription center page, subscribe a list or change consent level to others and submit form -> 8. Your test contact shall receive DOI email.
You could refer to following article for how to set up a subscription center:
https://docs.microsoft.com/en-us/dynamics365/marketing/set-up-subscription-center
Also, the tutorial about how to create marketing email:
https://docs.microsoft.com/en-us/dynamics365/marketing/create-marketing-email
Please feel free to ask question if you encounter any other problem during configuration process.
Regards,
Clofly