This is an English speaking forum therefore i’ll answer in English:
No, you can not set the state with an external command (no API supports this).
But Nuki locks of 3rd and 4th gen have (hidden) support for such doors. Here is more info about it: Enable NUKI to be used with Anti-Panic-locks in combination with door magnet
You will need a Nuki door sensor. If the feature is enabled you should be able to detect the “undefined” state and can execute e.g. a “lock” command afterwards in order to correctly reposition the lock again.