Now I see the problem.
Titlecasing ignores words that have capitals in the middle of the word (unless the whole thing is uppercased). Try titlecasing "ChaPter".
See:
src/calibre/utils/titlecase.py line 71
Code:
if INLINE_PERIOD.search(word) or UC_ELSEWHERE.match(word):
line.append(word)
continue
I originally took you at your word and tried to replace "Some text."