For example, in Harry Potter movie series, professor dumbledore character was played by Richard Harris in the first two films. However, due to his death, the character was played by Michael Gambon in the remaining 6 films. Are there any other instances like this, where the production company has to change its actors?
The archetypal example is Doctor Who where the lead has now been played by 13 characters (depending on how you count) over 50 years.
But there is a better example that spans both TV and movies: Quatermass. In the three Hammer Movies Quatermass is played by Brian Donlevy in the first two, then by Andrew Kier in the third. The 4th TV series was also released as a movie so we probably have to count John Mills in the film series.
In the 4 TV series he is played by Reginald Tate, John Robinson, Andre Morel and John Mills and that's if you don't count the recent BBC anniversary remake of the original series (incidentally originally broadcast live in 2005 as was the original in 1955) where he was played by Jason Flemyng.
Most of the changes were prompted by illness or unavailability of the key star playing Quatermass.