Hello,
You may check your device redirection.
open mstsc and click 'show options'
Open your rdp file from remote app (when you are using remote app, your browser will automatically download a rdp file)
Switch to 'Local Resource' and confirm the checkbox in 'Local Devices and resources'
If you are using a remote pc from your organization, check your group policy because it has a higher priority.
If redirection is all fine, check your device manager on your terminal side. (if there's any error and warning related to keyboard). If exist, update your driver (system version if necessary)
If the Answer is helpful, please click "Accept Answer" and upvote it.