anything is possible with enough time, money and skill. Is it a straight, drop in replacement? Probably not even close. How skilled are you in mechanical work and metal fab? If you want a bigger motor it would be a whole lot easier to just buy a different bike.
Not to be blunt, but if you're asking if the swap is "possible", its probably much more involved than you think. Again, not trying to be rude or anything at all man, but I've seen enough engine swaps in cars and bikes that even when swapping for an identical motor, there are usually a handfull of issues you have to fix right away. When people do engine swaps to something bigger or more outrageous, it's usually a super involved project, involving every type of fabrication and machining skill.
Engine swaps are basically guaranteed to be a massive money hole and almost certainly take tons of time and effort to make it even remotely work. Everyone has had the pipe dream about how awesome it would be to throw a bigger motor in your bike, since that gsxr600 motor online is only a thousand bucks, but it's just not reasonable for most. If you want a 500, just go buy that bike IMO.
But hey if you really wanna take on a huge project, and put in the time and commitment, be my guest. It would be a cool build and I'd love to see how you did it, should you do it. Not trying to shut you down or make you less hopeful. There are plenty of videos of crazy bike engine swaps on youtube, often a multi-series set of 30-60minute videos. If the youtube videos of it are hours and hours, imagine how long the actual process might be!
Hope this helps.
Going from fuel injected on the 300 to carbs on the 500, I wouldn‘t. Like was mentioned above, do some performance mods on the 300. OR, get a 400! The 400 is actually lighter than the 300 and much lighter than the porky 500.