When the Arduino is a Master, it does not use interrupts. The Wire library uses internally interrupts, but that is hidden from the sketch.
When the Arduino is a Slave, then the onReceive and onRequest handlers are running in a interrupts. That is when the trouble begins ![]()
The 'volatile' keyword should be used when the loop() processes data that can be changed in a interrupt. With 'volatile' the compiler uses the data from the memory location of the variable, and without it, the compiler can optimize things by keeping the data in a register without looking at the variable.
There are many bad examples for using a Arduino as a Slave. Even the examples on the official Arduino reference pages.
Serial functions inside a interrupt is a bad idea. It is. Everyone can confirm that.
The addition by @anon94801460 about disabling interrupts is of course correct. If you need to keep the 25 bytes together, then you might have to make a copy while the interrupts are turned off.
Basic tutorial by Nick Gammon: http://www.gammon.com.au/i2c
My wiki at Github: https://github.com/Koepel/How-to-use-the-Arduino-Wire-library/wiki.
If you read all the pages, then you are a I2C expert ![]()
Tutorial by Robin2: https://forum.arduino.cc/t/use-i2c-for-communication-between-arduinos/653958
It show how to transfer data over I2C. A 'struct' is the easiest way.
Tutorial by GolamMostafa: https://forum.arduino.cc/t/ch-6-i2c-bus-based-serial-data-communication/659019
I'm not sure if this is the Master-Slave example that I was looking for.