I had the same problem - Hiding sheet worked in debug mode but not when running the script. Wickets answer put me onto what did work - putting the flush statement BEFORE the hidesheet atatement.
Script operation order:
Activate DB_sheet
Push data array to DB_sheet
Activate User input sheet
SpreadsheetApp.flush();
SpreadsheetApp.getActive().getSheetByName(DB_sheet).hideSheet();