This is because it "depends"..
If your controller does internal ambient temp sensing, for temp compensation, then it needs to be as close to the bank as is possible, and safe. In other words if the controller is not sensing the same or similar temp to the batteries, without an on-battery sensor it will never be entirely correct, then your batteries will be seeing too high or too low a voltage.
Unless it uses a remote on-battery temp sensor lead then yes this would be the most optimal location in regards to properly charging your batteries..
For example I had a customer install an local ambient sensed MPPT on his vessel. The controller was outside the engine room in the locker backing up to cold Maine ocean water. The controller was regularly at a much cooler temp than the batteries, often a 30F spread or more. The batteries were in the engine bay, a horrible location for batteries.. The controller was actually compensating charge voltage up, based on controller location, instead of down based on battery location. A battery that charges at 14.8V at 77F can not charge at 14.8V at 95F or 110F or 120F...
It's not just the controller. The bigger issue is that your batteries should not be in the engine room either so your problem really started out with "stupid builder tricks". Builders don't care about the longevity or health of your batteries but they do care about saving nickles. As a result far too many batteries are installed in engine spaces that regularly exceed 100F. I have measured engine rooms 8+ hours after running still exceeding 110F. This is just bad news for batteries.
Purchase a controller with remote temp sensing and ideally remote voltage sensing such as the Morningstar TriStar MPPT series. Place it outside the engine room and run the temp and voltage sense leads to the battery bank..
As a bonus get the batteries out of the engine room into a more hospitable environment. With batteries in the engine room all charge sources should have on-battery temp sensing not just the solar..