Putting up my new ceiling fan into light fixture
The deep metal box cannot be used directly under a joist.

Whatever box you use should have its outer edge flush with the ceiling, or close to flush. The original plastic fan box which straddled the ceiling joist would have worked if the hardware for the new fixture had a metal mounting strap which could be secured into the ceiling joist through the slots used for the two long fan bracket screws.

The second plastic box (already installed) should work, but you would have to use a metal mounting strip (should be in hardware for light fixture) and use screws into the joist through the slots.

In original construction when only a standard light-weight fixture is to be installed, the box for the light is usually installed next to or between ceiling joists, but a basic installation of a fan box is a special fan box installed under (straddling) a joist. The boxes are different because of that, but you can adapt a fan box to hold a standard light fixture.