Does Cloudflare masking my IP make my server more secure?

Yes. The idea is that you block all HTTP and HTTPS connections to your server, except those originating from Cloudflare's network. Therefore, your server cannot be attacked directly - all HTTP and HTTPS requests must go through Cloudflare's web application firewall (WAF) first, before reaching your server; and Cloudflare's WAF will block any suspicious requests. So, it's not 'security through obscurity'.

Quite a bit of security requires obscurity. I.e., don't share your private keys. HOWEVER, the point of the near-universal hatred of "security through obscurity" is that, too often, people rely only on one layer of obscurity, and do not realize just how easy it is to guess.

Cloudflare provides some security by providing a bit of indirect obscurity. When used as one of many layers of security, it does increase your overall security, just as putting up curtains help, in addition to locking your doors and windows, and having an alarm system in place.

Cloudflare and similar services provide no protection against people who know your server's IP address. Security is like an ogre: It has layers.