Code:
local logger = require("logger")
local Device = require("device")
Device.input.rotation_map = {[0]={}, [1]={}, [2]={}, [3]={}}
logger.info("Hardware button rotation disabled by user patch")
That fixed it lol, the crashes are gone and the buttons are correctly mapped when I rotate the device.
Thanks again Renate!