The robot control instructions are a digital good.
The main reason work visas are required is not to prevent foreigners from doing work, it's to restrict and control their ability to live in the country, send their kids to school, receive medical care or whatever other social services might be available to residents, or do whatever kind of activity that the government doesn't want people to do and believes foreigners might do (discussing Tiananmen Square, disparaging Charlie Cook, advocating for gay rights, petty crime — whatever it is).
Hiring a foreign company, or foreign contractor, to perform work in their own country is almost always allowed. This is fundamentally not any different than a company having people answer customer phone calls in a call center in Bangalore.