Logic Pro X detecting different sample rates
I'm fairly new to Logic and music production in general and using the Logic Pro 10.6.1 trial on my Macbook Pro. I keep getting "Error trying to synchronize Audio and Midi. Check conflict between Logic Pro and external device" while playing back. Whenever I get this message, I get different sample rates that is detected such as 40 668, 40 920, 41 872, 39 724, 41 524, and even more sample rates detected when I get the error. Not sure what is causing this problem. I used a MIDI keyboard for some tracks, but I get these errors even when the keyboard isn't connected.
MacBook Pro 13″, macOS 11.1