The phrase screw the pooch, meaning to mess up, commit a grievous error, was made famous in Tom Wolfe's book The Right Stuff. The phrase is a euphemism from US military slang. The original expression was fuck the dog and meant to waste time, to loaf on the job.
Fuck the dog dates appears in print for the first time in 1935, but in 1918 another euphemistic version, feeding the dog, appears. The original sense dates to 1918. Over the decades, the meaning shifted to the current sense and the screw the pooch wording took the place of the original phrasing.