Thanks for your help. Before reading your advice this is exactly what the @Pi bot suggested to me.
I corrected the code and am currently testing. (Tomorrow at midnight 1 run automatically)
I had problems calculating the delay because I forgot to add the delay to the current time, and then the problem of setting the correct time for my time zone. We’ll see if the code works.