It is true, if you want to do it as in smart lighting, which starts counting the time to light turns off when the door is closed, it must be done with 2 automations. @Brad_ST made a list of smart lighting functions that were not in automations. Write only for motion, but for open/Close is the same.
If they are implemented all will be happy.
Now you can use, turn off after x minutes.
That clock starts when the door is opened and there is no way to stop it and it can turn off the light in unexpected cases.
I put in the example as a precondition that the light to be turned on was off. In this way if you have manually turned on the light to do something and someone opens the door, the automation does not trigger and the light will not turn off.