x265 are not too edit friendly with Vegas Pro, older versions especially. Upgrading to a newer version might help, but not guaranteed. You can try a trial version of Vegas Pro 20 and see if it works any better.
You can try and change some settings, which might improve your playback. Go into Options -> Preferences -> File I/O and enable any hardware decoding options you have, see if that helps. Also at the bottom there should be settings for “Hardware Decoder To Use” – try changing it to your GPU if it isn’t already.
If everything fails then one workaround is to convert these video files to another file format (like h264 for example) with something like Handbrake.
I’m pretty sure there are no codecs to install to fix x265 or x264 for that matter in Vegas – not a thing.