Asking as I've got a lot of spare components lying around that I'm planning on turning into a NAS. If it doesn't work out I'll buy a pre-built enclosure and reuse the drives.
If you have the knowledge or want to learn about it, and you are willing to deal with these tasks (configuring the system and keep it updated), the DIY approach makes sense.
I was on that situation some months ago, and I didn’t want to spend time in system maintenance, so I bought a NAS device.