Can an inspector enforce issues with existing plumbing outside the scope of a permit?
This widely varies by municipality.
In general - big generalization - if this is something that isn't in the permit, something that is not being currently worked on, and something that is not an occupancy danger is out of scope for an inspector when visiting during a permit sign-off.

Isn't on permit - pretty clear your wash machine is not part of bathroom
Something that is not being currently worked on - so let's say you were getting this sign-off but then inspector notices you have outlets open in the room with the washer.   It doesn't take much and inspectors will say you are working on something to be permitted.   For instance I hide my toilets (boxes included) when doing minor refacing of a bathroom - which may include new vanity, new toilet, update plumbing (not change it - just make sure it is right and not old parts that may fail), and a paint job.   Inspectors see the toilet in the garage when inspecting something else... &quot;what else do you have going on here&quot;.   Then I have to have an inspector out 3 times and quirky rules for a facelift.   Yours is clearly not being worked on, but this is a very hazy area!
occupancy danger - this would normally be under electrical issue or fire rating issue.   There is other gray area but don't think a washing machine hose could get there.

Now the other thing to think about is that some cities have presell inspections that have to take place before you can sell your home (not the buyer's inspection).    If your city requires that I would figure that that drain-off that you currently have will not pass.   I would also figure anyone who has your house inspected will have this noted and may require you to make it code before buying.
If I were in your house and might sell it the next couple years I would probably call inspector, and just ask about it.   What can I do to make it code?   Most inspectors will give you advice on this, especially basic plumbing requirements.   If I were planning on living in house for next 10+ years... there will probably be a new inspector by then.