Are there any risks or disadvantages to building software from source, compared to installing a package? Can it mess with my system in any way?
I usually avoid it because I’ve found it to be a faff and often doesn’t work anyway but in a couple of cases it has been necessary.


Like many have said, the main disadvantages are:
The main advantages are:
If you’re interested in compiling your own software maybe consider using a distro whose package manager allows to compile stuff, Gentoo is the obvious choice, but Debian based distros can also do that.
Using GNU Guix to build can solve the “difficult to install” issue and also help with dependency management, however compilation time can’t be avoided. Advantages remain, however, thanks to package transformation options!
Arch also kinda allows that if you write custom PKGBUILD file. It’s easy to write for simple stuffs that are based on make/cargo etc.
It’s time consuming if some program gives you 100s of lines of code in bash script to install their program though.
Edit:
Another disadvantage of building from source is dependency management. You might accidentally uninstall some dependencies, the standard library versions might change and break your packages, etc.
Using package manager mitigates that.