Whenever flexible_table is being used for exporting data the page MUST NOT print standard header or footer (or anything else for that matter). The only thing that should be executed is table setup and out.
So either a custom theme is used that messes this or the code itself is incorrect. If any of you uses some custom theme try with some stock theme just for the sake of testing.