The problem arises because the difference is an interval, not a date. If you construct a Date from it, then it is interpreted relative to the epoch, 01 Jan 1970. While you can extract the hours from it, as soon as it is bigger than 24hrs, this will fail. EG a diff of 25hrs will become 02 Jan 1970 01:00:00:000 and so getHours will return 1, not 25.
Once you have the difference between the two dates you need to do some maths on it to extract the data you want. EG the number of hours is Math.floor((end - start) / 60 * 60 * 1000)
let end = new Date(2000, 1, 1, 15, 20, 10, 453)
let start = new Date(2000, 1, 1, 10, 0, 0)
let diff = end - start
HH = Math.floor(diff / 3600000)
let remainder = diff - (HH * 3600000)
MM = Math.floor(remainder / 60000)
remainder = remainder - (MM * 60000)
SS = Math.floor(remainder / 1000)
remainder = remainder - (SS * 1000)
let sss = remainder
console.log(`${HH}:${MM}:${SS}:${sss}`)
This will print out 5:20:10:453
as required. However, it will also work with dates greater than 24hrs apart:
let end = new Date(2000, 1, 2, 16, 0, 0, 0)
let start = new Date(2000, 1, 1, 15, 0, 0)
let diff = end - start
HH = Math.floor(diff / 3600000)
let remainder = diff - (HH * 3600000)
MM = Math.floor(remainder / 60000)
remainder = remainder - (MM * 60000)
SS = Math.floor(remainder / 1000)
remainder = remainder - (SS * 1000)
let sss = remainder
console.log(`${HH}:${MM}:${SS}:${sss}`)
This prints 25:0:0:0
.