Why am I getting "null" error?

Yes, that is the whole point. Creating a timer puts that block of code into an independent function, and sets an alarm clock to run it.
The rule that created it continues immediately, and will normally exit long before the timer block runs.
The handle allows you access to these “detached” timers later, so that you can cancel or reschedule.

Your original code should work, although it is really a ‘dumb’ thing to do - create and immediately reschedule - and I think you were unlucky to fall in a timing race created by multi-threading timer handling alongside timer creation.

It looks like you are ramping a dimmer? There are examples to be found -

A lot of these dimmer solutions do in fact create a timer and almost immediately reschedule … I think they get away with it because the rescheduling is within the timer’s own code block, not external.