Yoda dying off camera and never being seen again would have been pretty lame. In the original making of ESB book, Lucas laments he couldn’t shoot a scene for Jedi during production on ESB, as there was the issue of saving and storing the Dagobah set for the next film. What he had in mind either had not been written yet, or the need to finish ESB took precedence.
Found the quote. ‘Empire Building’ by Garry Jenkins, p. 262:
“Marquand was not entirely averse to expressing an opinion. It had been his idea that Yoda be re-introduced in the film. In the original draft, Luke had simply referred to a conversation he had with his master before he had died. ‘I insisted we put him back. I felt we needed to see the conversation’, Marquand said at the time.”