Gpio problem

Hello, I have a Digi Xbee 868 LP (XB8-DMUS-002)

I need to drive Xbee Gpio as Output, hence I send these commands:
+++
ATD45
ATP25
ATAC
ATCN

as reported in the datasheet I intentionally not include ATWR because I want that gpio are drived in Volatile mode (i.e.: when the module is powered off and then on, I need that the gpio is found in the initial condition).

For example: initial condiction (including ATWR command):
+++
ATD44 (low)
ATP24 (low)
ATWR
ATAC
ATCN

at runtime
+++
ATD45 (high)
ATP25 (high)
ATCN

after power off and power on again I expected that D4 = Low P2 = low
but instead I find
D4 = High P2 = High…

after write you need to read the all the parameters once then only it set other wise it will be old values.