ob_start(), ob_get_contents()  do not work in preprocess functions?
I think nothing is left on buffer in Drupal. After evaluating each template the rendered output is preserved as value and passed to outer level template. In this scheme Drupal might be getting buffered content and clearing it across each template.

That is why you should look for variables in that scope.