What you just described is known as an INDIRECT waste and it is legal in most civilized places on this planet. Why not ask the person who said it is illegal to give you a code reference.
Most code bodies would love having washing machine’s and dish washers discharge through this type of “Air Break” as this kind of set is guarantees no possibility of cross connections or potable and non potable water.
As long as the floor drain is properly sized and vented the local inspector should kiss your feet for having the wisdom for installing one of the safest type of drainage systems available with no chance of a mechanical failure.
Again check local codes and demand to know what section of the sanitary code you are in violation of.