Boris Johnson's advice to the Ukraine was primarily based on distrust of Russia - skepticism that Putin would not in fact honour any peace accord between the two countries.
In that, Johnson was far from alone. Respected Ukranian political journalist Roman Romaniuk revealed that members of Zelenskyy's inner circle harboured exactly the same doubts as to Putin's trustworthiness on this matter. Also - and most tellingly - a subsequent poll found that more than 80% of the Ukranian population feel the same way towards Vladimir Putin.
As well they might!
Russia has a bad track record for completely disregarding an agreement once such ceases to be advantageous to itself. (e.g. The 1941 Non-Aggression Pact with Japan). Furthermore, Russia will use so-called "peace negotiations" to prolong a war, as it did in Korea. This tactic- often referred to as "Talking and fighting for advantage" - was used by Russia and its allies to extend the Korean War by over two years, and turned that conflict into a proper War of Attrition (which always favours the side with the greatest amount of manpower at its disposal). In this present war with Ukraine, Russia would be holding all the advantages if this, too, were to turn into one of attrition.
Ukraine could indeed have had peace - if it were to have completely capitulated to Russia. That, though, is an extraordinary thing to expect of any sovereign country. Also, a path of pacifism seldom ends happily.
In this part of the world (the South Pacific) there is the 19th Century example of the Moriori people of the Chatham Islands. The Morori had adopted a culture of non-violence, and elected to pursue the same course when faced with invasion by the Māori from New Zealand. All that did, however, was lead to their rapid conquest, enslavement and then virtual extermination as a people. (We could also mention the allied leaders of the late 1930s, who mistakenly thought that they could prevent another world war by giving in to Hitler).
Given its past record, any hesitancy about engaging in "peace talks" with Russia is quite understandable.