Turning on Ikea Trådfri lamp with set brightness acts weird

I got myself an Ikea Trådfri lamp with adjustable colour temperature to start with home assistant. I have Sonoff ZBDongle-E set up with zigbee2mqtt. Manually controlling the light works fine as well as turning it on with automation. The problem arises when turning it on with a brightness. The light turns on with the set brightness as expexted, but after a second it goes back to the brightness it was set to previously. Then, after around 10 seconds, it goes to the brightness that was set on the automation. If the light is already on, the brightness gets set as expected.

Here’s the automation action:

And a video of the problem. I first control the light manually, setting the brightness and turning the light off. Then the automation gets triggered.
https://streamable.com/omizz6

What is going on here?