this approach , however , did not sit too well with the powers in rome and led to his imprisonment during 1576 and 1577though , as fate would have it , it was in prison he was to compose his finest work .