DALI : How to set a scene level?
Your commands correct for storing and querying Short Address 0, and you are getting a response from Short Address 0 so it looks like you have got a control gear with that address attached. And you are setting and reading the same scene number, 1. But the reply to QUERY SCENE (1) LEVEL is MASK (0xFF) which is the default value instead of the value you are trying to set, 64 (0x40).
This is because you have not got enough delay between the repeats. You have 5ms but the spec requires at least 12.7ms between any frame and a forward frame. Also note that the 100ms maximum repeat timing was for DALI-1 and is now tightened up to 75.0ms maximum for a transmitter (Table 17 of IEC62386-101 Ed 2).
The maximum repeat time specification had to be adjusted because in the old version, the shared tx/rx requirement for 100ms +/- 10% could mean that a transmitter sending with 110ms spacing between repeated commands would not cause a receiver receiving with a 90ms window to store the setting.