That's odd. As you change the buffer size in the menu, do you observe a difference in memory usage when you compile the sketch?
Do you know how much MIDI data the sender sends at once? Is it more than 1KiB?
Another possibility is that mocolufa uses a small buffer that overflows, but that would be a bit odd, as it receives the message from the USB connection, so there's flow control.
You can check if mocolufa works correctly by uploading an empty sketch to the Arduino (this is important!) and then ─ after you've uploaded the empty sketch ─ connecting the TX and RX pins to each other.
Then open a MIDI monitor, and log the mocolufa MIDI input (i.e. the messages that the Arduino is sending to your computer). Connect the mocolufa output to the software that's sending the SysEx messages to the Arduino.
Disconnect TX and RX before uploading a new sketch.
That's shown here:
You change the line that says:
UBRR1L = 31; /* 31250Hz at 16MHz clock */
See the first column (fosc = 16.0000 MHz,
U2Xn = 0) of Table 18-12 in https://ww1.microchip.com/downloads/en/DeviceDoc/doc7799.pdf.
Compiling the firmware might prove tricky, so I wouldn't want to go this route unless there's really no other option.