Can I use an M4ramped barrel with a non m4 upper?

Are there any disadvantages to using a non m4 upper with a m4 ramped barrel?

https://www.m4carbine.net/showthread.php?t=193

Yes you can.
Not optimal for very fast cycling ARs and a slightly steeper feed angle, but not generally a big deal in properly functioning carbines.