Some countries call this "hawala", where it is illegal to give cash to someone in one country, and the receiver can collect it from a broker in another country.
Is it illegal to give cash to someone if there is no forex involved? Is it legal if invoices are made?
It is illegal if you are in "any" part of the money transmission space. There are three components to money transmission:
1. Sending Money (Load money, taking money to send from one country to another).
2. Receiving Money (Off-Loading money, paying money out to recipient)
3. Someone to Take money from #1 and convert it to money for number # (the market maker).
If you are involved in any portion of this without a license (assuming your country requires it to be a licensed operation), then it is clearly illegal.
Most people who function as "Human ATMs" are dispensing money out locally, based on a local (domestic) transaction.
It is not about invoicing. If you are aware that the transaction is one that by-passes regulations, then your involvement is deemed illegal.