Canon has already discontinued the M-Series camera line. So any further investment in that would not be wise.
What current EF lenses do you have? Are you sure you have EF or EF-S lenses? And not EF-M lenses?
If you do purchase an R-series camera, you could make use of EF or EF-S lenses with an additional adapter (Canon EF to RF adapter). However, do note that it will not be possible to use any EF-M lenses with an R-series camera.
Having said all that, an R-series camera would be a step up since it's the future of where Canon is going. The R7 would have a decent amount of features and capabilities above what you have with your M50.
But, what is your budget? And what specifically are you finding limiting/concerning with your current M50 camera?
12/05/2023: New firmware updates are available.
09/26/2023: New firmware updates are available.
08/18/2023: Canon EOS R5 C training series is released.
07/31/2023: New firmware updates are available.
05/18/2023: New firmware updates are available.
03/30/2023: New firmware updates are available.