A typical led pot lights installation looks like this, with two or three ways push connectors in the box used to connect this light to the previous one and to extend the wire to the next one
When you need to extend a wire that is short why can't you use a two ways push connector the same way? (let's say it is close to a pot light so by removing the pot light it is at an arm length distance in the ceiling so you can practically reach to it)