Using --replay-gain command generates ReadOnly flac files, due to that issue, replaygain data can't be written to generated file. My guess is that someone added --r feature for generating ReadOnly files and command isn't properly separated from --replay-gain
Using Flac v1.3.3 2019/08/04
FLAC has no feature of creating read-only files. If this is still an issue, you should post a little more info on what system you're using, on what filesystem you are working, what exact commands you use etc.