You are mixing and matching java.time.ZonedDateTime and the JS native joda-js ZonedsDateTime.
You should stick to the JS native. When interacting with the API provided by openhab-js a JS ZDT is always expected.
test = items.getItem('test');
test.sendCommand(-16)
test.persistence.persist(time.toZDT('2025-01-01T12:00'), '-10', 'jdbc')
test.persistence.persist(time.toZDT(), '-15', 'jdbc')
The other two are stored as epoch I think which is a correct date time, It’s just not formatted nicely. The last line represents January 11, 2025 5:30:14.191 PM GMT and the middle line represents Wednesday, January 1, 2025 11:00:00 AM GMT.
I don’t know why it’s different between the built in persistence and using the .persist command but all the entries have a correct timestamp, just in two different formats.
Unfortunately even if they are valid timestamps, openhab can’t properly deal with them. I run this script for a new item (which is configured for jdbc persistence):