The following quotation is taken from the book
Ramsay MacDonald by David Marquand, London: Richard Cohen Books, 1997
In the spring of 1927 [Ramsay MacDonald] contracted a mysterious throat infection during a visit to the United States and almost died. He had to go into hospital in Philadelphia towards the end of April and was not allowed home until the end of May.
He was leader of the Labour Party. So after he has died of that throat infection in April or May 1927 in the United States, the Labour Party would need to elect a new leader, which at that time was by Labour MPs only.
In the elections to the Executive Committee of the Parliamentary Labour Party [commonly called the Labour shadow cabinet] in December 1926 Philip Snowden came first with William Graham second. Arthur Henderson came twelfth and last. In the elections in December 1927 Snowden was again first, Henderson came second, while Graham dropped to third place. John Clynes was the deputy leader so did not contest these elections.
In a Labour Party leadership election in May 1927 the candidates would most likely be Clynes, Henderson and Snowden. Any of these three could be elected. Whoever is elected leader the result of the general election on 30 May 1929 would be much the same as in OTL, with Labour becoming the largest party in the House of Commons but without an overall majority.
I expect the policies of a Clynes or Henderson or Snowden government would similar to that of MacDonald's 1929-1931 government. In that government Clynes was Home Secretary, Henderson was Foreign Secretary and Snowden was Chancellor of the Exchequer. If Snowden was Prime Minister the Chancellor would be William Graham or Sidney Webb. Graham was Financial Secretary to the Treasury in the 1924 Labour government and President of the Board of Trade in the 1929-1931 Labour governmemt. Webb was President of the Board of Trade in the 1924 government.
If Snowden is PM presumably he forms a National government with the Conservatives and Liberals in the summer of 1931. But in OTL neither Graham or Webb [then called Lord Passfield] joined the National government headed by MacDonald.
If Clynes or Henderson is PM then presumably a National government is not formed, and the Labour government continues as long as the Liberals support them. There would have to be a general election before June 1934. A general election in 1933 or 1934 could very well be followed by an election in 1938 or 1939.
MacDonald's reputation would be much higher than in OTL. There would also discussion in counter-factual/alternate history about what the policies of his government if he had not died. but became Prime Minister in 1929.
This scenario reminds me of the death of John Smith in May 1994. Both men were leader of the Labour Party while it was in opposition, though Smith had not been Prime Minister.