A direct fire cannon is inherently bad at indirect fire.
First, because their carriages are designed for the guntube to fire in a relatively horizontal mode. To fire high angle to reach ndirect targets, the carriage has to handle a much wider range of recoil stresses, and that at least doubles the weight of the carraige and recoil mechanisms, an also tends to make the gun much higher - making it far more vulnerable to counterfire if it is in the front line firing directly. The famous German 88mm antiaircraft gun is a good example of this: since its mount was designed to allow it to fire vertically against airc raft, at high angles as an indirect fire weapon, and horizontally against enemy armor, the resulting mount was over 2.5 meters high and weighed more than the mount for a 105mm cannon. When used as an antitank gun against tanks that had good high explosive cannon, like the Soviet KVs and T-34s in 1941, while they knocked out a number of Soviet tanks, they also suffered appalling losses, reaching 50% in some units by October 1941.
Second, because direct fire weapons use cartridges combining the propellent and shell, they cannot vary the muzzle velocity the way howitzers with separate propellent charges can, and so it is extremely difficult to drop shells onto all targets at various ranges. That results in 'dead spots' that they cannot hit at all.
Third, the techniques for indirect fire - setting fuzes, calculating range and azimuth, pacing the crews to provide steady fire over long periods - are entirely different from those for direct fire, which emphasizes fast reaction when a target appears and 'bursts' of firing at high speed frequently followed by a quick escape to avoid return fire. That means crews need, essentially, twice the training time to become proficient at both. And if the same gun/cannon is to be used for both types of fire, it needs entirely different ammunition loads for each type of mission: indirect fire is almost always conducted with high explosive ammunition, direct fire with armor or concrete-piercing rounds, smoke shells, illumination shells, and less amounts of high explosive ammunition. That complicates the logistic burden, and the supplying artillery ammunition is already the greatest burden on any logistic apparatus - it amounted in WWII to 75% of all supplies delivered, by weight.
So, while U S, British and German artillery all supplied 'direct fire' antitank rounds (usually shaped charge types after 1941) to their regular artillery, in most cases they supplied only a tiny amount - 4 - 6 rounds per piece out of a basic load of 100 - 120 rounds total, because direct firing at tanks was considered to be only an emergency measure. When the Germans tried using their 105mm howitzer against Soviet armor in 1941 as emergency antitank guns, they lost on average one howitzer for every tank they knocked out, and in one case (7th Infantry Division, October 1941) an artillery battalion lost 7 howitzers destroyed by tank fire while knocking out only 2 tanks and damaging 3 others. Basically, that was 2 bat teries of artillery destroyed while knocking out a single platoon of tanks, a very bad ratio in any army at any time.