There is a huge difference between grants and contracts. A contract requires the recipient to perform something known to be likely possible (for example, paint a house, create a database structure, write a program with a well defined functionality and algorithm, measure the level of XYZ protein, etc).
On the other hand, a grant always involves the risk of failure or negative result, accepted by both grantor and grantee. Example for a grant can be "Identify the inhibitor of XYZ protein syntheses" and example of negative findings can be that "neither ABC, BCD nor CDE are inhibitors of XYZ". Here you couldn't find what you asked the money for, but you also established that your best shots, ABC, BCD and CDE, were not valid choices. So even if you failed the grant, at least the next one trying to get the research done knows what not to start with. At the moment you wrote the grant, the scientific community was probably believing strongly that one of your choices is the right one, so your results will likely cause a change in perception, hence an advance. This way, you or somebody else will find that MNQ is the right approach to the problem.
On the other hand, saying that "I've couldn't do research, was too busy teaching, but I've spent the money in a noble cause" disqualifies you from further grants.
If your PI was not expert in the field, why was the grant awarded anyway? My understanding of being awarded a grant is that I have to demonstrate that I am the best person IN THE WORLD able to conduct this research (PhD in ML/CS here), or at least the 11th, but the first 10 specialists are busy with something else.
Legally nobody seems to be liable of anything. You mentioned multiple objectives were met, so I guess there were at least three objectives in the grant, hence, missing one would be a "damage" less or equal then 2000. We seem to talk about petty cash here, or there is some personal issue your PI has with the granting agency.
Even if some liability is to be established, the PI acted as an agent of the institution he/she works for. Since he/she cannot own patents on the perform research, I find highly unlikely to be personally liable in the things are not going as planned.
Morally it is hard to judge. In an ideal world, both the granting agency and your PI carry some guilt, because of not doing their research ahead, which is explainable by the small amount in cause.