I am using Logic Pro 12.4. This problem is happening when I try to record a midi track using my piano keyboard. As soon as the track starts recording it turns on record on another random track and overwrites it, while recording on the midi track too. What is especially weird is that the midi software track is overwriting an audio track (you would think it would check the track type first). I tried hiding the audio track and instead it went to the next track. Finally, as a work around, I moved the midi track to be the last one in the project and was able to record it without overwriting another track.
This is a particularly pernicious bug because I might not have noticed that it was overwriting a different track, and then been unable to undo the recording and deal with the issue. I am running the macOS on a M4 Mini with the latest OS software. I thought I should report this as it needs to be fixed.