Thin wall to block LED light from hitting photodiode?
My advice is to not bother doing what you're doing, and spend the $3.50US to get the part designed for the task, like https://www.digikey.com/product-detail/en/osram-opto-semiconductors-inc/SFH-7060/475-3174-2-ND/6137022