Sen. Patrick J. Toomey (R-Pa.) is trying to fix a tax law snag that prevents retailers and restaurants from taking advantage of one of the law’s most generous perks.

An amendment Toomey filed to an appropriations package under Senate consideration would correct what has become known as the “retail glitch,” a provision in the 2017 tax act that keeps establishments from writing off the costs of interior renovations and improvements immediately. Lawmakers’ conference report shows they didn’t mean to prevent those writeoffs, and Republican leaders have acknowledged the error.

Toomey’s amendment, obtained by Bloomberg Tax, tries to correct the...