Strange a ovr error is not produced. When an int goes over or under its boundaries a ovr is generated. I I know a ESP32 produces a ovr error, which can be detected. Oi! Almost forgot the Uno's timers produce overflows that are detected.
The only thing that's plainly clear is that you've written bad code that doesn't work and you don’t' know why.
You're right, nobody wants to wade through hundreds of lines of your messy code. So, the fastest way to get real help is to post a small, complete code that compiles and demonstrates the problem at hand (and only that problem). This is called an MRE. It will enable people test your code, confirm the problem, and provide solutions that can be verified.
Of course unsigned arithmetic overflows. And it does so in a manner that's precisely defined by the language specification. But, since @ phoneystark20201 hasn't posted a complete code that includes variable types, there's no way to tell what he's done wrong.
According to ISO/IEC 9899:201x (open-std.org) "A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type."
Sorry, I was referring to "wrap around" as overflow. Wrap around clearly happens with unsigned arithmetic (i.e. always using unsigned subtraction when dealing with millis()). I think that's what the section you quoted is saying.
I have told you what variable types they are..... bytes. Said that in the first post.
I didn't think such a simple issue would require an MRE. Not every question surely requires a program to demonstrate it.
If I was having library or a more complicated problem, I would post the entire code.
It's not 'bad' code, it's just code that doesn't appear to do what I thought.
Don't worry. I am not getting into a pointless argument over it. Thank you for everyone's kind advice, an I will sort the problem out myself