It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

I started BG1 with a Fighter/Cleric and planned to play up to Throne of Bhaal with this solo character. In the mid of BG2 the character reached Level 24 (Fighter) and Level 25 (Cleric) both at roughly 4000000XP. Then the character stopped to accumulated the XPs from fights and didn't continue to level up.
Is this intended in the game or is it a bug?

The level cap with TOB is 8000000XP unless you use a mod like BG2tweaks to remove it.
It's intended. The ToB xp cap is 8 million xp, just like the one in vanilla BG was 95k xp, and in BG 2.5 million or so.

You can get rid of the cap through the BG2Tweaks mod, there is an option to do so and you don't have to install any of the other stuff if you don't want to.
And just for completeness, BG1 Tweaks also has a level cap remover for vanilla BG1. Of course BG2 still restricts any imported characters XP to the BioWare limits.