A damaged and/or weak extractor can affect vital tension.
With the information included I will need to make some assumptions as to age and condition of the gun, magazines and ammunition you are using when the brass is ejecting and hitting you in the forehead. It goes without saying that safety glasses are required when shooting recreationally, and a brimmed hat with the brim forward is recommended, especially with a pistol that misbehaves such as yours does.
It sounds like the empty cases coming straight back at you aren’t coming into contact with the ejector before leaving the ejection port.
If the gun has had a lot of rounds through it, the extractor may be worn and/or weak. This would create a condition where the cartridge case would be extracted, but not held firmly against the breech face until the ejector was encountered. Once the cartridge case clears the chamber, it would be free to move as the slide travels to the rear.
On occasion, the rim of the case drops into contact with the mouth of the top cartridge in the magazine, which ejects the spent cartridge at an angle similar to what you describe. This same condition can happen when the last shot is fired if the rim of the case contacts the feed lips of the magazine as the slide travels to lock back.
Testing the extractor tension is a relatively simple process in a 1911 or most semi-automatic pistols.
First, fieldstrip the pistol and lay all parts aside except for the slide. Turn the slide upside down—sights toward the floor—and insert the rim of a dummy cartridge under the hook of the extractor in a position of similar alignment to that of an extracted cartridge. Reposition the slide so the sights point upward and notice the position of the dummy cartridge under the hook of the extractor.
If the position changes or the cartridge falls to the floor, the extractor should be adjusted or replaced. The extractor should have sufficient tension on the rim of the cartridge to hold it in position until it is pushed out of place.
This means when the gun fires and the cartridge case is extracted from the chamber, the case is held by the extractor on the breech face until the slide overrides the ejector, which pushes the case that hinges on the extractor to the side and out of the ejection port.
If the extractor loses control of the cartridge case prior to its contact with the ejector, the ejection pattern becomes erratic and unpredictable.
It would be worth noting if the problem you are having was unique to a specific magazine or type of ammunition. This may help isolate the odd ejection characteristics your pistol is exhibiting, though my money is on the extractor.