This incident was subtly explained by the israelis in the book “Spymasters of Israel”. The Russians had managed to intercept the intelligence being gathered by the Americans on the USS Liberty, and the Israelis discovered the leak. The Israelis asked the Americans to leave the area & plug the leak. American intransigence over the issue led to the attack.
An excuse only. There was no such leak and the USS Liberty was not the only asset active at the time. NO SUCH LEAK. The Israelis would have provided the specifics of the leak if it existed. This, however, follows the theory that the US was deliberately sharing information with the Russians to ease their anxiety concerning Israel’s intentions regarding their client state - Egypt. That excuse is justing feeding off of this theory IMHO.