I would check the documentation of both devices. Water heaters expect to take in cold water and output hot water. Putting two heaters in-line means one is taking in water of varying temperature. I would be surprised if manufacturers anticipate this.
Discussion
I have not seen that in documentation yet. They have a temperature control. So they obviously turn on and off to maintain temperature at set level.
If the water is coming in already at that temperature or higher, seems their controller would just turn off without any harm.
When there’s no electricity, both just let water pass.