It's not only legal, but it's required, if something changed that makes it hard for you to be impartial.  An attempted bribe or threat would do that.  Being a witness to expose that bribe or threat would really do that.