What make and model mouse?
Which browser is being opened? Chromebooks by any chance?
Are you using any "hot key" apps - something that will automatically direct a right click to your browser and then YouTube"?
Check the following link:
https
/www.digitaltrends.com/computing/how-to-right-click-on-a-chromebook/
Not a solution per se but the link should provide you with some insight as to what else to check/reconfigure on your system.
Otherwise, please provide more information. Thanks.