...it's difficult,if not impossible, to offer you good advice on the simplest practical solution that will work without taking the machine screw that no longer holds ouit, and inspecting the threads on both it and the hole as well (as stated above).
It honestly might be as simple as replacing the machine screw with one that still has good threads. Or as you suggest, rethreading the hole a size bigger and using a larger screw (unlikely, but still a possibility).
If you can post decent photos of the thing, removed, and of the hole, empty, you'll get better advice.
Or take it to someone who works on bikes regularly, or anyone you know who might be a tinkerer with mechanical stuff.