First of all fiqh is based on ijtihad. Then there are 4 known madhabs but not 4 ways in doing things as all these madhabs have two common sources: the Quran and the Sunnah. So in cases where there's a source the possible ways are limited to the different narrations: This would mean in general you may have 2 or less possible ways. If it comes to ijtihad (concluding rules from the sources for new problems) you still might find a consensus or sometimes even not find a consensus in the same madhab. In many cases even the Founders of those madhabs had two different opinions because they knew about different or contradictory hadiths or maybe changed their mind later based on new information or just a review of their former fatwa on a matter.
When the Messenger of Allah (Peace be upon him) died, there was no clear instance on what is to do and what not. The sahaba (May Allah be pleased with them) were wide spread in the Muslim countries where they have been teaching Islam and Sunna and Quran, while many died in Medina and Hijaz some have been living in 'Iraq and a-Sham. At the time of sahab there have been 4 major "scholars" known by the Abadillah the 4 Abdullah's : Abdullah ibn 'Omar, Abdullah ibn Masu'd, Abdullah ibn al-'Abbas and Adbullah ibn 'Amr ibn al-'Ass. Of course many other sahaba have been there but those four have had the most influence. For example maybe a sahabi like abu Huraira knew a lot of Hadiths but an other had better skills to conclude rulings from them.
A division in opinions began already at the time of sahaba and they have had influence on the tabi'yn and so on. But they have had also some kind of consensus in known cases. You must understand, that at this time nobody had a good database to search for a hadith so they all could only conclude rulings from the given data or information they had as this was what they have been taught (See for example in Sunan abi Dawod, Sunan a-Nasa-i, Jami' at-Tirmidhi). For some more or less obvious reasons the sahaba who have been living in the 'iraq had much more to deal with new Problems, so because they have been less in quantity they may also have less sources for hadith which made them with the time more and more flxible and able to conclude rulings from the "few" sources they had and build up juridic jurisprudence. While those in Hijaz haven't had that quantity of "new" problems. So in 'Iraq a ra'y (opinion based) jurisprudence school has developed with the time, while in al hijaz the school was mainly based on the original sources -mainly the hadiths and sunna- (ahl al hadith).
Please also note that even at this very early days there have been some political and tribal differences, who lead to some disagreements which may find their source more in these "internal combats" rather than in the Islamic sources of knowledge: so some of the followers of those sahaba later refused ahadith narrated by "disputants"! I'm not saying that the sahaba would agree with this, as we don't know, but this is what happened afterwards!
What is the origin of the concept of there being four ways to do things?
There's no origin of that concept there are factors:
political factors like the hanafi school being for a part of the Abbasid Dynasty the preferred school (Abu Yousuf the student of abu Hanifa was the highest qadhi/qazi after his master refused and has been tortured) and then after the fitnah of quran the hanbali school was much appreciated. The maliki school was appreciated because of the knowledge of Imam Malik as his book was one of the first sahih hadith collections (It includes at least 500 hadiths which you may find in any other hadith collections beside some 200 more in the final revision and you may find in those books ahadith narrated by him which are not in the muwatta'a as it was more a book of ahkam and fatwa). The student of abu Hanifa Imam Muhammad ibn al-Hassan has narrated the muwatta' and when he used to recite from it he had always a bigger audience as in his other lessons. Note that many teachers of Imam Malik where his students later, as he was one of the first whom have been given the title Amir al-mu'minyan fil hadith, his muwatt'a is a revised summary of much more then 100000 hadiths and narrations about ahkam he has collected beside some of his fatwas. Imam a-Shafi'i was welcomed in Egypt at first as he was a student of Malik, but than more and more accepted by the former students of Imam a-Laith ibn Sa'ad. But at the time there have been many other good scholars who had reached a high level of knowledge some were even set much higher than those four like Sufyan ibn 'Oyyana, Sufyan a-Thawri, Abdullah ibn al Mubarak, al-Awzaa'i , a-Laith ibn Sa'ad.... and among the tabi'yn an even larger number of great scholars whom had a madhab of their own and followers.
People of the Maghreb and Andalusia once converting to Islam had a strong relationship to Medina as the "city of the Messenger of Allah (Peace be upon him)" so they were among the first to become shi'a or "maliki" and they also adapted the (quran) reading of imam Nafi' as a major "standard". Of course if in a major city a qadhi/qazi following one madhab has been appointed he would be in favor for colleagues of the same madhab! For example: it's said that Yahya ibn Yahya al-Laithi the Andalusian scholar, who was the last one to have his muwatta' version revised by Imam Malik had good relationships to the rulers in Al-Andalus therefore it was up to him to choose the qadhi's.
Now if you want to know at what time the sunni school limited the madhabs to only four. then it's hard to say but maybe this happened somewhere between the 5th and late 6th century due to a consenting silent (as nobody tried to do ijtihad al mutlaq and all scholars only wrote comments on former madhabi sources). At least Qadhi 'Iyad pretend in his book about the scholars of the Maliki school that in al-Maghrib one couldn't anymore find scholars of any other school then the maliki madhab.
Note that ibn Hazm (a-dhahiri) lived only a century before in al andalus and the later dynasty of the almohads الموحدون encouraged ijtihad in any madhab no matter if it was in fiqh nor 'aqidah.
Some people say it was ibn Salah (others have also been named) that declared the closure of the doors of ijtihad and that only four madhabs are exiting. But the dhahiri school still exists in the salafi thoughts.
An answer for the quoted hadith
as you may see in my answer here and read in the relevant link the answer of ibn al-Majushoun a Student of Imam Malik, who has been asked about this matter which the maliki school rejects even if there have been an athar (Hadith or only teaching of a sahabi) about it in the Muwata' with the Answer: "We have quoted it and rejected it so that people know, that we knew it and rejected it" ...why? Because they either had a better/stronger narration or something based on the osol of their madhab.
فقيل لـابن الماجشون: لمَ رويتم الحديث ثم تركتموه؟ قال: ليعلم الناس أنا على علمٍ تركناه.
Note that there are two narrations in the book that we now call al-Muwatta' (as there have been as much as there have been approved versions of the students of Malik, but maybe less then 10 have still survived until today, beside other scholars later -apparently- also adapted that name, but i don't know about an other muwatta') which speak about "placing the hands right over left in salat" and these one was one of the rare narrations which Malik accepted from an 'Iraqi narrator who has been later considered as weak. While the other is a marfu' narration. In the Maliki madhab there's no consensus about this very matter (those who refer to the popular placement of the hands among malikis are basically referring to mukhtassar khalil, while the maliki's of al 'Iraq have always chosen the well known option), but note that even in the shafi'i sources you may find a saying of Imam a-Shafi'i where he is preferring not to place the hands right over left. Why?: Because of many reasons the hadith of the man who didn't pray well for example is suggesting that each body part should find it's place some scholars said the natural position of the hand while standing is beside the legs! Some others said that not placing them one over the other is a major challenge (as when placing them as described you may not have been challenged with your khushu') so you may gain thawab. But one point might be that only people from al 'Iraq narrated this (and in hijaz narrators from al 'Iraq where not that much trusted). An other source is that the major narrator of the right hand over left in an other hadith didn't have any objections to this ... so it is an ijtihad matter in first place!
And Allah knows best!