You've got two questions in there really so this is going to be a long, two-part answer.
1 - Is the TARDIS sentient?
There are a lot of unanswered questions in Doctor Who - about both the Doctor themselves, the Timelords, and the secrets of the TARDIS. However, I think it is wrong to assume that the TARDIS is a living, conscious thing that makes decisions by itself.
The episode "The Doctor's Wife" put the TARDIS into a human body and saw it talk to The Doctor as if it were a person, able to express things for the first time. It also spoke of other TARDISes as 'sisters'. However, this is a highly unusual and inconsistent episode (although brilliant). The episode also shows that TARDISes are entirely mechanical, as we later see pieces of wrecked TARDISes which The Doctor was able to put together and make a working one. That wouldn't be possible if they were part organic and actually 'dead' as Idris stated.
They clearly do have a degree of sentience, The Eighth Doctor called his TARDIS "sentimental" after it resurrected his companions. But The Doctor's habit of personifying the TARDIS and calling it "old girl" or "old thing" is really not so different from the way some people talk about their cars in real life. For example, the Third Doctor also personified his car by calling it 'Bessie'.
Despite The Doctor's Wife giving such strong suggestions that the TARDIS is sentient, other episodes show it cannot function entirely independently. Rose had to break into the TARDIS in order to reach the Ninth Doctor in The Parting of the Ways. In Blink, The Doctor had to rely on Sally Sparrow to return the TARDIS to him. If it were independently sentient, it could have just returned to him by itself.
We do know that the TARDIS is symbiotic with its pilot. This was discussed in The Two Doctors when the Sontarans understand that their TARDIS prototype cannot function without a Timelord. They learn from The Doctor that the symbiotic link is through his eye. This, or a similar idea, was later explored in the Eighth Doctor pilot when The Master uses the Eye of Harmony on board the Doctor's TARDIS to connect to The Doctor's own eye. It also has a 'psychic circuit that stays linked to the entire crew while they are outside - this is how the translation matrix works.
I would have to conclude, considering all of the above, that the TARDIS has an AI of some kind, but is not capable of independent thought. The strong personal connection between it and The Doctor is down to the symbiosis mentioned above, as well as the personification of machinery which is a common trope even outside of science fiction. Although The Doctor's Wife went further than any other episode in showing the TARDIS to have some kind of 'spirit' and personality, I think it is worth noting that this episode written by Neil Gaiman was heavily edited by then-showrunner Steven Moffat. Gaiman talked in his blog about material that was cut out that included a lot more backstory on The Corsair and his relationship with The Doctor on Gallifrey. Moffat cut it out because he felt it revealed too much about The Doctor's past which would destroy some of the mystery of the show. It certainly seems that Gaiman wanted to expand on the mythology of Doctor Who in this episode and in doing so may have gone a little bit further than the showrunners might have alone. Although a brilliant and well-received episode, and certainly part of 'canon', I don't think it should alone shape our view of the 'sentience' of the TARDIS.
2 - What could cause the TARDIS to malfunction and crash?
Just about anything. It is mechanical. Wires burn out, pipes burst, and it crashes. We normally see the TARDIS materialise on a planet's surface, not physically land (or crash), yet we also regularly see it physically travelling through space. We sometimes forget that it is a space and time machine.
We saw the TARDIS hurtling to the planet Lakertya at the beginning of Time and the Rani after a space battle leaves the Doctor for dead (he regenerates shortly after), yet the TARDIS lands intact and materialises on the planet surface. This would suggest the TARDIS AI does have safety mechanisms that prevent a crash-landing. But in The Runaway Bride The Doctor pilots the TARDIS through Earth's atmosphere and we see it tumble around crashing into physical objects, so it isn't a given that the TARDIS always safely materialises and cannot physically crash into things. In The Day of The Doctor, the War Doctor deliberately piloted his TARDIS through a wall, smashing through it.
As the TARDIS travels through physical space as well as through time, it has to be assumed that it could malfunction and crash if its systems were damaged. It may have a landing system that controls materialisation/dematerialisation and safety mechanisms that enable this if the Doctor is not able to - but if these were out of action then it surely would crash.
It is also worth noting that, in Night of the Doctor, the TARDIS was onboard Cass's ship when it crashed - a crash that killed both Cass and The Doctor beyond regeneration. He was only able to regenerate because the Sisterhood of Karn resurrected him. Although we never see how the War Doctor leaves planet Karn, the Doctor has only ever had one TARDIS throughout his known regenerations, so we have to assume that the TARDIS survived this crash and The Doctor was able to pilot it off the planet.