Unfortunately, I am the owner of the Gigabyte z390 UD motherboard. After some research, I found out that no one can run them at 4000mhz on this motherboard, only at 3866. In the end, I preferred to go with 3600mhz cas 16.
If you can run them at 4000mhz, then it's worth it even if it has cas 18. The high frequency compensates for it. If you asked me about the difference between 4000 cas 18 and 3600 cas 16, I would say it's proportional to the money, as the difference is completely negligible and better towards 3600 cas 16. And the reason is simple.
If we calculate the latency between them, we have:
cas 18 for 4000 Mhz x 2000, which gives us 9
cas 16 for 3600 Mhz x 2000, which gives us 8.88
The difference is negligible.
However, you should definitely know for sure if your motherboard can run them at 4000mhz, otherwise, no, it's not worth it.