FFMpeg - why recording a video and then compressing it produces a smaller size video than recording with combined options
Your first command is transcoding using FLV1 codec to store in .flv. This is not the same input provided to the x264 encoder as when directly encoded to H264. In fact, it's quite worse, since the default target bitrate set for FLV1 is 200 kbps (although for full desktop capture, it will overshoot by a lot). This has less complex detail in general so it's easier for x264 to encode than the full fidelity raw desktop input.