Could not fill because the current canvas size does not match
I noticed lately for the past month or so that whenever I use Alt+Backpasce (foreground fill) to fill a layer with the foreground color, Photoshop gives me the error, "Could not fill because the current canvas size does not match". When looking online for a solution I saw a post on reddit, that says that it has something to do with resizing the canvas between the current state and the history state selected for the history brush.
I am not using the history brush, all I am doing is using Alt+Backspace to fill a color on the canvas. I've never had this problem until recently in 2021 and I've ben using Photohops since 2007. What is happening? I found another post that is similar on graphic design stack exchange, but there were no replies. This error happens randomly so I can't pin point any specific cause. If I make a new file, it works fine, then I go back to the old and sometimes it is fixed, other times it isnt.
Also if I manually make a selection and right-click and select fill, and foreground it works fine.
EDIT: This is ONLY a problem with FOREGROUND, the background shortcut CTRL + Backspace works fine.
Specs:
OS: Windows 10 Build 19042
CPU: Intel Core i7‐4770K 3.5GHz Quad‐Core
RAM: 32 GB
GPU: Asus GeForce GTX 780
