Does the wallbox have to be connected directly to the inverter?
No, the inverter doesn't always have to be part of your EV charging setup. For example, a system like the go-e Controller connects to current transformers to detect excess solar on its own, bypassing the inverter for data collection.