On firebases documentation it says:
Even with persistence enabled, transactions are not persisted across
app restarts. So you cannot rely on transactions done offline being
committed to your Firebase Realtime Database. To provide the best user
experience, your app should show that a transaction has not been saved
into your Firebase Realtime Database yet, or make sure your app
remembers them manually and executes them again after an app restart.
I think the key word there is "Transactions" which are a very specific kind of write operation. (See description here).
If you're just doing a regular ol' write to the database and not sticking it inside a transaction block, your write should be saved, even across an app restart.