A man who was remanded into custody after representing himself in court branded the judge a “d******d” as he was taken to the cells.