I believe it should work just fine for most projects. But for my case, I was only suggested by AI that the clone with CH340 (for USB to serial) won't be different from my Nano in terms of latency, only after I ordered one online. But I shall wait and see.
The Mega2560 is indeed the same as a nano (Atmega328), but offers more pins and peripherals. And none of these should be the real source of your latency. Using hardware MIDI instead of the serial to USB adapter on the 2560 or nano should neither, because the CH340 can work with speeds much higher than MIDI baudrate. (MIDI is only 31250 bits per second and with 3 bytes for a note on command it takes 1ms for a note to be send. A good musician might notice latency in the order of 5ms, but most of us won't. On the AVR running on 16MHz this means a lot of instructions.
Sounds like my understanding of what bare metal programming means is wrong. Isn't it code that is run directly by the MCU without relying on an OS (as is the case for, e.g., Raspberry Pi)? I think using the Arduino IDE to program with any of the Arduino families is just bare metal programming. Am I wrong here?
To me using the Arduino framework is similar to using an OS. There is a lot of hidden functionality under the hood that might get in the way of your task of scanning the keyboard and emitting MIDI data.
Bare metal, to me, means starting at the reset vector and write every bit of code yourself, or in case of using libraries make sure to have a good insight in what they do. This gives total control over the MCU/CPU. Attached is a bare metal piece of code I wrote to control a mixing valve for a central heating system. It uses the UART to receive commands and reply to them. Pure C and no libraries needed.
Your keyboard scanning could be done in exactly the same manner.
Certainly we should not rely on AI too much. Probably you are right here on MIDI. The problem I have here is the reliance on a serial port emulated through USB, which I understand is the bottleneck as the source of latency.
It does not have to be. It depends on the host system on how it handles the data if there will be latency or not. On the nano side the UART just outputs serial data and the CH340 buffers it and waits for the host to collect it. Normally this should occur every milli second and as such align perfectly with MIDI speed.
I'm not sure exactly how by adding 74LVC1G126 this can be fixed. I don't have the full picture view of this pathway. (I mean I need an end-to-end solution, or at least, with a solution that I know how to interface with the existing components or sub-solutions).
This would make the nano output true MIDI and allows connecting to a real synthesizer that has a MIDI input. In such a setup the only latency could be caused by either the nano or the synthesizer, and if it turns out to be the synthesizer it means it is a piece of shit.

If it is the nano, the programming of it is shit.
Keyboard scanning, even with velocity is a very simple process. MIDI is not that hard either, especially when it is only note on and note off messages that need to be send.
I will have a look into the hardware synthesizer pathway (is Teensy Audio Shield one of these?). This way I'm sure the noticeable latency will be gone.
With a hardware synthesizer I mean something like a Korg, Roland or Yamaha synth. These have MIDI and are proofed to be working without to much latency.
But a Teensy 4.1 with an audio shield can be used to, if there is MIDI input and the right firmware to turn it into a synthesizer.