Thank you for your question. I am a solicitor in Scotland. Based on your scenario the sheriff has acted improperly. He should have excused himself from the case. If he didn't and reached a judgment then that could have been subject to appeal. In additional a complaint could be made to the Scottish Courts Service. Happy to discuss further. Please leave a positive rating so that I am credited for my time.