You’re correct that it will reduce file size but encoding lossy to lossy is foolish. You will introduce compression artifacts and have an objectively worse quality image, the encode will take much longer than if you used a proper lossless source, and if you don’t set your configs right you’ll strip out subtitles, tags, chapters, etc
Additionally if the h264 was already compressed by a lot h265 won’t save all that much space, giving you all the downsides with basically no upside
Only dummies encode lossy>lossy. The debate about lossy>h265 is one thing (h265 is not for archival) but h264>h265 will result in visible distortion
Don’t encode lossy to lossy. The encoding will take forever and the image quality will suffer. If you want file size savings redownload your media in h265 or whatever. Or temporarily download a lossless copy, encode, and delete.