Unless you have a way to manually control the focus, I doubt it. Tracking a tiny target like that above a magnet would confuse the auto focus on just about any camera. With manual focus and very steady hands, maybe?
The best results I've had with small things are using the super zoom telephoto lenses like on samsung s22. I haven't seen a smartphone macro lens that takes decent photos of things yet (unless the subject is perfectly still). Perhaps the latest gen has found a way but in smartphone land you're mostly relying on software post processing since they capture so little light.