Keyboard and trackpad stop working sometimes

Hey everyone,

I have had this weird issue for some time now and I can't figure out what causes it or how to prevent it from happening.
Sometimes during usage of my laptop my laptop keyboard and trackpad become unresponsive. The buttons for brightness will still work as do the buttons for turning the screen on and off and the keyboard lights but the others are completely unresponsive. If I add a USB keyboard and mouse I can continue to use the laptop as normal using this keyboard but the laptop keyboard remains unresponsive.

I have only found this issue Keyboard stops working at Ubuntu Mate 18.04 but there is no answer there either and I am running Ubuntu 20.04.2.

My window manager is Macro (adaptive compositor).

It is really irregular. Sometimes it happens twice a week and sometimes it doesn't happen for months.
After a reboot it always seems to be working again.

Does someone know how to fix this or how to troubleshoot this problem?