If there was spare capacity, but there doesn't seem to be much at all. 1 in 10 inter-country wheat shipments will be Ukrainian, and it's about 1 in 7 for corn, probably other crops as well. Repurposing that shipping capacity isn't easy either, from a logistics standpoint. It can take up to a month just for a ship to cross the Pacific, before any other route complexities. It doesn't help that there's over 100 such cargo ships tied up in Ukrainian ports either, a decent proportion of which will be the subset of cargo ships fitted out for bulk grain transport.
The last few years have already shown us how delicate the global logistics & supply chains are. It doesn't take much to stretch them near to the breaking point, and we're already close to that point.
Entirely taking out Ukrainian grain shipments is not a small sliver of the total amount of long-distance grain shipping, but instead requires a significant increase in the total deadweight-ton-miles. We are talking about taking 10%+ of international wheat/corn/barley trade and making it travel 3–6x further than it otherwise would, in an industry that usually runs on thin capacity margins. (Disclaimer: I am not an expert and have not done a detailed calculation.)
That is a potential logistical nightmare. Hopefully smart people with the power to make large temporary changes are working on ameliorating the pain and keeping everyone fed.
Which would be really bad if it was a global increase, but when it's a tiny sliver of the market you only need a sliver of spare capacity.