For detective to go bad repelled The Guardian (9)
I believe the answer is:
protector
'the guardian' is the definition.
(synonyms)
'for detective to go bad repelled' is the wordplay.
'for' becomes 'pro' (as in being 'pro' something).
'detective' becomes 'tec' (synonyms).
'to go bad' becomes 'rot' (I've seen this before).
'repelled' is a reversal indicator.
'rot' back-to-front is 'tor'.
'pro'+'tec'+'tor'='PROTECTOR'
(Other definitions for protector that I've seen before include "Box at Lord's say" , "Patron" , "Guardian; regent" , "Defender" .)