How to 2-pass h264 with CRF and maximum bitrate with ffmpeg?
What's the correct way to generate the highest quality possible file
  inside a bitrate constraint using ffmpeg with x264?


There is no "correct" way. This is still an evolving area of research, and about half the articles you have read on the subject are more marketing that they are science. The "correct" way may also be different for every video. Netflix for example just encodes the video a couple dozen ways, and keeps the one it thinks is best and throws the rest away.

The closest thing to a "best" single answer, would be 2 pass placebo capped CRF.