Interesting proposal. I think it'd take a lot of fine tuning to work as desired though.
You'd have to make the tax low enough to still retain a significant benefit for the company, but high enough to aid in providing a social safety net. You'd also have to ensure that it's hard to get around this legislation without making it so broadly applicable that AI research and development are penalized.