Great question — answering as the UphillTech team:
The electrical box does not appear to be fan rated. This means you must replace the box with one that is rated for hanging a ceiling fan. There are many types of Fan rated ceiling boxes. . you should be able to find something that will work. Install the proper box with it's outer edge flush with the outside edge of the ceiling drywall. (You may need some shims for spacers.) Repair the areas of drywall that you cut out, or purchase a ceiling medallion to cover the area. With that done you can install the fan with no more issues.
Full answer by RMDman: https://diy.stackexchange.com/a/332389 (CC BY-SA 4.0).
Need it done for your business? UphillTech.