Man 'lost the plot' before raid that found bomb: court