@Ned Carey Hey Ned, as an attorney who has worked on several breach of contract cases (although not in MD), it appears that the judge has confused the requirements of a valid contract with the law of assignments.
Based on what I have read here - and I do not know the details of your specific case - the judge is essentially suggesting that a contract is void for indefiniteness b/c we are missing a material term of the contract: the buyer.
This is a stretch. In order to have a valid contract, there must be offer, acceptance [mutual assent] and consideration.
Step 1, Seller is making a contract with the buyer and the contract contains an assignment clause (and/or assigns). Both parties sign the deal. We have offer, acceptance and consideration - a valid, enforceable contract!
Step 2, Buyer ASSIGNS his rights under the contract (right to purchase the property) to his cash buyer (B2). Such an assignment is completely legitimate under contract law. This does NOT make the contract void, which is what the judge seems to be suggesting.
The Restatement (Second) of Contracts defines it as "An assignment of a right is a manifestation of the assignor’s intention to transfer it by virtue of which the assignor’s right to performance by the obligor is extinguished in whole or in part and the assignee acquires a right to such performance."