There used to be places that sell H9 bulbs that have been modified to fit in an H7 housing. This could potentially cause issues as the H9 is a 65 watt bulb while the H7 is 55 watts and occasionally higher wattage bulbs will cause housings or connectors to melt due to the higher heat and current draw. This seems relatively unlikely when going from 55 watt to 65 watt (I usually see it when people throw in "off road" 85 watt or higher bulbs), but it's a possibility. The modified H9 bulbs also lack the coated tip that an H7 has, which will result in additional glare for oncoming drivers. This is, however, something of a moot point with high beams as the driver should be switching back to low beam for oncoming drivers anyway.
On the whole, replacing the stock H7 bulbs with modified H9 bulbs for only the high beam portion is likely a reasonable swap with minimal potential negative effects, but I believe that the modified H9 bulbs are more difficult to find these days as people have moved on to trying to sell LEDs.
If you have the HID lights (which are combination low and high beams), the auxiliary light should be an H7 bulb. But previous owners will often just jam the wrong bulb in. For example, on my old S70 the rear turn signal requires a PY21w bulb, which is not common in the US. The pins on the base are 150 degrees offset instead of 180 degrees like the more common 1156 (the idea being that the unique base would prevent people from putting clear bulbs in a socket that required a yellow turn signal bulb). You would not believe how often I saw those cars with clear rear turn signal bulbs because an owner had forced an 1156 bulb into the PY21w socket. My guess is that, since it's only one side, a previous owner of your car had a high beam go out and looked up the high beam bulb for the non-HID lights by mistake and then forced the wrong bulb into the socket.
Example of the different turn signal bulb bases: