Section 4 - Army Dress Regulations - All Ranks
Officers not in Actual Military Service.
Officers in the categories listed at (a), (b) and (c) above who are not in actual military service may wear uniform on the occasions listed below:
I) Parades in connection with the official birthday of the Sovereign.
II) Royal and State Ceremonials.
III) Ceremonies in connection with Remembrance Day.
IV) Regimental functions or celebrations at a military station, with the approval of the regimental authority concerned.
V) Occasions in connection with which an announcement regarding the wearing of uniform is made by the Ministry of Defence beforehand.
vi) Other occasions, on application to the Ministry of Defence PS12(A).
https://assets.publishing.service.g...ds/attachment_data/file/619983/2017-03109.pdf
I suppose that the funeral service qualifies as a "royal ceremonial". If so, then, according to your information, Prince Harry could wear his Captain uniform.