According to the NYS Bar Association, in Ethics Opinion 1237, "A lawyer may not accept the referral of real estate closings from a real estate agent who is associated with a real estate company owned by the lawyer where the real estate agent and the real estate company will split the brokerage commission earned on the real estate transaction, regardless of whether the attorney agrees to waive in favor of the real estate clients the portion of the real estate commission due to his real estate agency."
So, a broker / lawyer cannot take referrals of closings from an agent who works at that lawyer's / broker's real estate brokerage. It does not matter if the lawyer "waived any brokerage commission" he would otherwise receive in favor of his client.
The reason is that his agent will nonetheless receive a commission split and that constitutes the payment for referrals.
The takeaway is that an attorney should choose to do closings or work in brokerage, not both.