FLAC all the way. FLAC compression level doesn't matter as far as data integrity is concerned. Higher compression levels use more CPU to encode/decode but also gives the smallest file sizes. Low compression levels are the fastest to encode/decode. On most computers, the CPU usage is negligible, so I opt for the smallest file size to (marginally) reduce bandwidth for backups and reduce SSD/HDD wear.
You can losslessly go from FLAC to WAV to FLAC again at any compression level, any number of times; as long as your memory/CPU/motherboard isn't corrupting data. I always use workstations with ECC memory to
avoid data corruption.
WAV doesn't have built-in checksums, so you'll need to manage them yourself and/or rely on CRC from ZIP or some other method to notice bitrot as HDD/SSDs age and fail. Having a filesystem which checksums data (e.g. ZFS, BTRFS) also helps.
If you get a corrupt FLAC file and no good backups; the "flac" command-line tool has a "--decode-through-errors" switch. Having good backups is better, obviously.